GithubHelp home page GithubHelp logo

palanceli / libgooglepinyin_old Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pkg-ime/libgooglepinyin

1.0 2.0 2.0 50.96 MB

Home Page: http://git.debian.org/?pkg-ime/libgooglepinyin.git

CMake 1.41% C++ 96.25% C 2.20% Shell 0.14%

libgooglepinyin_old's People

Contributors

happyaron avatar palanceli avatar zchongr avatar

Stargazers

 avatar

Watchers

 avatar  avatar

libgooglepinyin_old's Issues

编译

额外引入了gtest、glog和gflag:

$ git submodule update --init --recursive

$ git submodule add https://github.com/google/googletest.git modules/googletest
$ cd modules/googletest
$ git checkout release-1.8.0

$ cd libgooglepinyin
$ git submodule add https://github.com/google/glog.git modules/glog
$ cd modules/glog
$ git checkout v0.3.5

$ cd libgooglepinyin
$ git submodule add https://github.com/gflags/gflags.git modules/gflags
$ cd modules/gflags
$ git checkout v2.2.1

以上是三个模块对应的版本号。我尝试在一台机器提交后,在另一台机上貌似不能更新下来。我希望达到的效果是一条命令之后,直接可以cmake - 编译。❗️这个问题留作以后再查❗️

一旦本机有了这三个模块的代码树,以上工作就不用再操作了。接下来是编译和安装,我的系统是macOS,当系统升级后,macOS SDK版本发生变化,这些模块需要重新编译:

cd modules/googletest
mkdir _build && cd _build && cmake .. && make && make install

cd modules/gflags
mkdir _build && cd _build && cmake .. && make && make install

cd modules/glog
mkdir _build && cd _build && cmake .. && make && make install

词库生成

创建词库的命令

  • 编译时自动生成。
    libgooglepinyin/data/CMakeLists.txt中有如下命令:

    add_custom_command(OUTPUT dict_pinyin.dat
          DEPENDS dictbuilder
          COMMAND dictbuilder 
          ${CMAKE_CURRENT_SOURCE_DIR}/rawdict_utf16_65105_freq${DATA_SUFFIX}.txt 
          ${CMAKE_CURRENT_SOURCE_DIR}/valid_utf16${DATA_SUFFIX}.txt 
          ${CMAKE_CURRENT_BINARY_DIR}/dict_pinyin.dat)

    它会在编译完成后执行dictbuilder生成词库。词库的生成路径为:libgooglepinyin/build/data/dict_pinyin.dat

  • 通过dictbuilder生成。
    dictbuilderlibgooglepinyin的子模块,是用来生成词库的可执行程序。我在代码dictbuilder/pinyinime_dictbuild.er.cpp中,将词库默认生成路径也改成了该路径,因此调试的时候,可以不用设置命令行参数,直接调试。

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.