Git Product home page Git Product logo

libcangjie2's Introduction

This is a C library implementing the Cangjie input method.

Below is a trivial example of how to use it:

#include <stdio.h>
#include <cangjie.h>

int main() {
    Cangjie *cj;
    int ret = cangjie_new(&cj, CANGJIE_VERSION_3,
                          CANGJIE_FILTER_BIG5 | CANGJIE_FILTER_HKSCS);
    CangjieCharList *chars;
    CangjieCharList *iter;
    ret = cangjie_get_characters(cj, "d*d", &chars);

    if (ret == CANGJIE_NOCHARS) {
        printf("No chars with code '%s'\n", "d*d");
        cangjie_free(cj);
        return 1;
    }

    iter = chars;

    while (1) {
        if (iter == NULL)
            break;

        printf("Char: %s, code: '%s', classic frequency: %d\n",
               iter->c->chchar, iter->c->code, iter->c->frequency);

        iter = iter->next;
    }

    cangjie_char_list_free(chars);
    cangjie_free(cj);
    return 0;
}

For more details, refer to the documentation, either online or the one shipped with this software.

Development happens on github, and stable release tarballs will be available when we reach that point.

History

This library is based on Wan Leung Wong's libcangjie.

In fact, when writing it, we tried to preserve the original libcangjie API, because Wan Leung had done a pretty good job with it.

However, we felt the need to start afresh for a few reasons:

  • due to real life constraints, Wan Leung didn't have any time to dedicate to libcangjie any more

  • we felt that some of the technical decisions in the original libcangjie were not the wisest choice

Nevertheless, this library would probably not exist if Wan Leung hadn't opened the way, so we feel it is important to give him credit.

Thank you very much Wan Leung!

Legalities

libcangjie2 is offered under the terms of the GNU Lesser General Public License, either version 3 or any later version.

We won't ask you to sign a copyright assignment or any other kind of silly and tedious legal document, so just send us patches and/or pull requests!

libcangjie2's People

Contributors

bochecha avatar linquize avatar yookoala avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.