构造前缀树:
1.src/main/java/resources/generateLocationDat.py:使用python将网上拉下的location.json转成自定义的格式location.dat
2.src/main/java/slner/trietree:前缀树实现,使用了泛型 可扩展,最大正向匹配MaximumMatching方法
实体识别:
src/main/java/slner/core/SimpleLocationRecognizer.java:因为区域可能重名,所以前缀树每个node存的是Location list,又得识别出实际信息(比如:没有省份得通过城市得到省份),因此这里处理较复杂
Testcase:
就测了一个方法,见src/test/java/
见SimpleLocationRecognizer.java 可测试
-
Notifications
You must be signed in to change notification settings - Fork 0
识别出一句话里省市县信息
License
jianzhichun/simple-location-ner
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
识别出一句话里省市县信息
Topics
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published