casuallyname / geocoding Goto Github PK
View Code? Open in Web Editor NEW地址标准化
License: MIT License
地址标准化
License: MIT License
请问可以增加一些1.4.3版本新方法(save、match、analyze)的使用说明和例子吗?感谢
输入:四川省成都市郫都区西源大道1311号3栋4单元1楼102号
segment方法,seg_type = 'ik',
分词结果list为:['四川省', '成都市', '郫', '都', '西源大道', '1311号', '3栋', '4', '单元', '1楼', '102号']
期望结果list为:['四川省', '成都市', '郫都区', '西源大道', '1311号', '3栋', '4', '单元', '1楼', '102号']
请问有啥办法修正结果吗?感谢!
输入:四川省成都市双流区西航港街道临港路四段9号和贵久居福4栋3单元4层402号
分词结果list为:['四川省', '成都市', '双流', '西航港街道', '临港路', '四段', '9号', '和贵久居福', '4栋', '3', '单元', '4层', '402号']
双流区的区字被分词没了?是啥原因
添加自定义地址失败,geocoding.addRegionEntry(1, 321200000000, "A街道", geocoding.RegionType.Street) 总是返回 False
无法得到想要的结果
Address(
provinceId=320000000000, province=江苏省,
cityId=321200000000, city=泰州市,
districtId=None, district=None,
streetId=None, street=None,
townId=None, town=None,
villageId=None, village=None,
road=None,
roadNum=None,
buildingNum=None,
text=A街道
)
respect~使用过程中遇到一些问题,无法有效添加自定义地址。
自定义示例代码如下:
geocoding = Geocoding()
geocoding.addRegionEntry(1, 321200000000, "A街道", geocoding.RegionType.Street)
print(geocoding.normalizing("江苏泰州A街道"))
返回的结果:
Address(
provinceId=320000000000, province=江苏省,
cityId=321200000000, city=泰州市,
districtId=None, district=None,
streetId=None, street=None,
townId=None, town=None,
villageId=None, village=None,
road=None,
roadNum=None,
buildingNum=None,
text=A街道
)
并不能将A街道添加到street参数里。
另外,批量导入自定义地址文件应该放在哪?地址文件的格式是啥?
similarityWithResult方法
用例
text1 = '江西省南昌市新建县新建区长堎镇工业三路东侧保利紫云6栋'
text2 = '广东省深圳市宝安区长堎镇工业三路东侧保利紫云6栋'
Address_1 = geocoding.normalizing(text1)
Address_2 = geocoding.normalizing(text2)
print(geocoding.similarityWithResult(Address_1, Address_2))
报错:
File "D:\python3.8\lib\site-packages\GeocodingCHN\Geocoding.py", line 136, in similarityWithResult
return MatchedResult.from_java(self.geocoding.similarityWithResult(address_1.java_class, address_2.java_class))
File "D:\python3.8\lib\site-packages\GeocodingCHN\model\matched.py", line 64, in from_java
return cls(doc1=Document.from_java_class(java.getDoc1()),
File "D:\python3.8\lib\site-packages\GeocodingCHN\model\document.py", line 44, in from_java_class
return cls(terms=[Term.from_java_class(i) for i in java.getTerms()],
AttributeError: 'NoneType' object has no attribute 'getTerms'
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.