palanceli / libgooglepinyin_old Goto Github PK
View Code? Open in Web Editor NEWThis project forked from pkg-ime/libgooglepinyin
Home Page: http://git.debian.org/?pkg-ime/libgooglepinyin.git
This project forked from pkg-ime/libgooglepinyin
Home Page: http://git.debian.org/?pkg-ime/libgooglepinyin.git
额外引入了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
生成。
dictbuilder
是libgooglepinyin
的子模块,是用来生成词库的可执行程序。我在代码dictbuilder/pinyinime_dictbuild.er.cpp
中,将词库默认生成路径也改成了该路径,因此调试的时候,可以不用设置命令行参数,直接调试。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.