https://github.com/flier/mmseg4a
MMSeg for Android
https://github.com/flier/mmseg4a
Last synced: over 1 year ago
JSON representation
MMSeg for Android
- Host: GitHub
- URL: https://github.com/flier/mmseg4a
- Owner: flier
- Created: 2012-03-25T12:09:39.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2012-05-19T06:33:57.000Z (about 14 years ago)
- Last Synced: 2025-01-21T22:09:43.986Z (over 1 year ago)
- Language: C
- Homepage:
- Size: 2.55 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
Introduction
===========
mmseg4a is an Android porting of the [LibMMSeg](http://www.coreseek.cn/opensource/mmseg/) library, which base on the [MMSEG ](http://technology.chtsai.org/mmseg/) algorithm.
Usage
===========
You should load the dictionary first with the [SegmenterManager](https://github.com/flier/mmseg4a/blob/master/src/lu/flier/mmseg4a/SegmenterManager.java) object, and create a [Segmenter](https://github.com/flier/mmseg4a/blob/master/src/lu/flier/mmseg4a/Segmenter.java) object with createSegmenter method, call it's segment method to take the tokens.
~~~~~ java
SegmenterManager mgr = new DictionaryLoader(DemoActivity.this).load();
String tokens = mgr.createSegmenter(true).segment("这是一段需要分词的中文").getTokens();
~~~~~
Please check the [DemoActivity](https://github.com/flier/mmseg4a/blob/master/demo/src/lu/flier/mmseg4a/DemoActivity.java) class for more details.
Performance
===========
You could run the performance tests in the [demo](https://github.com/flier/mmseg4a/tree/master/demo) folder.
loaded dictionary in 567ms
loaded a sample file with 31458 lines/2761.38 KBs in 5135ms
found 1110124 tokens in 29765ms (92.77KB/s, 37296.29 tokens/s)
(HTC DHD with 1G CPU and 768M memory)