All Projects → ldwonday → Zh Address Parse

ldwonday / Zh Address Parse

Licence: mit
全网识别准确度最高的中国大陆收货地址智能解析

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Zh Address Parse

Area Puppeteer
基于 puppeteer 的中国行政区域抓取爬虫
Stars: ✭ 144 (-56.1%)
Mutual labels:  china, address
Expostal
Elixir binding for Libpostal - a library for parsing/normalizing street addresses around the world. Powered by statistical NLP and open geo data.
Stars: ✭ 80 (-75.61%)
Mutual labels:  parser, address
China
🇨🇳 一个轻巧的中国的地区、民族以及节假日信息的查询PHP库
Stars: ✭ 51 (-84.45%)
Mutual labels:  address, china
Administrative Divisions Of China
中华人民共和国行政区划:省级(省份直辖市自治区)、 地级(城市)、 县级(区县)、 乡级(乡镇街道)、 村级(村委会居委会) ,中国省市区镇村二级三级四级五级联动地址数据。
Stars: ✭ 11,727 (+3475.3%)
Mutual labels:  china, address
Identity Address DB
(China) 1. MySQL 身份证 地区 数据库(包含已被合并的区县,详见README) 2. PHP 验证身份证号是否正确 3. 从身份证号中获取 性别 生日 年龄 出生地 等信息 4.路过留个star
Stars: ✭ 38 (-88.41%)
Mutual labels:  address, china
Jspoon
Annotation based HTML to Java parser + Retrofit converter
Stars: ✭ 306 (-6.71%)
Mutual labels:  parser
Kgt
BNF wrangling and railroad diagrams
Stars: ✭ 312 (-4.88%)
Mutual labels:  parser
Exprtk
C++ Mathematical Expression Parsing And Evaluation Library
Stars: ✭ 301 (-8.23%)
Mutual labels:  parser
Pyresparser
A simple resume parser used for extracting information from resumes
Stars: ✭ 297 (-9.45%)
Mutual labels:  parser
Ics Py
Pythonic and easy iCalendar library (rfc5545)
Stars: ✭ 322 (-1.83%)
Mutual labels:  parser
Swagger Cli
Swagger 2.0 and OpenAPI 3.0 command-line tool
Stars: ✭ 321 (-2.13%)
Mutual labels:  parser
Typed Query Selector
Better typed `querySelector` and `querySelectorAll`.
Stars: ✭ 316 (-3.66%)
Mutual labels:  parser
Demofile
Node.js library for parsing Counter-Strike: Global Offensive demo files
Stars: ✭ 305 (-7.01%)
Mutual labels:  parser
Chat Censorship
Data related to investigation of chat client censorship
Stars: ✭ 317 (-3.35%)
Mutual labels:  china
Pycharm Themes
TextMate themes for PyCharm
Stars: ✭ 305 (-7.01%)
Mutual labels:  china
Craftinginterpreters
Repository for the book "Crafting Interpreters"
Stars: ✭ 4,298 (+1210.37%)
Mutual labels:  parser
Trojan Go
Go实现的Trojan代理,支持多路复用/路由功能/CDN中转/Shadowsocks混淆插件,多平台,无依赖。A Trojan proxy written in Go. An unidentifiable mechanism that helps you bypass GFW. https://p4gefau1t.github.io/trojan-go/
Stars: ✭ 4,049 (+1134.45%)
Mutual labels:  china
Astroid
A common base representation of python source code for pylint and other projects
Stars: ✭ 310 (-5.49%)
Mutual labels:  parser
Intellij Plugin V4
An IntelliJ plugin for ANTLR v4
Stars: ✭ 318 (-3.05%)
Mutual labels:  parser
Algebraicengine Fraction
a calculating engine~
Stars: ✭ 311 (-5.18%)
Mutual labels:  parser

China's delivery address parse

New Feature

增加自定义解析国家统计局数据,数据更新至 2020-11-20,代码:https://github.com/ldwonday/zh-address-parse/blob/master/app/lib/getMcaGovData.js

Preview

Test page

Syntax

AddressParse(address[, [option|0|1]])

option可选参数属性列表

参数名 说明 类型 是否必填 默认值
type 解析方式 Number 0
textFilter 预过滤字段 Array []
nameMaxLength 中文名最大长度 Number 4

Usage

npm

npm i zh-address-parse -s

import AddressParse from 'zh-address-parse'

import

import AddressParse from './dist/zh-address-parse.min.js'
// options为可选参数,不传默认使用正则查找
const options = {
  type: 0, // 哪种方式解析,0:正则,1:树查找
  textFilter: [], // 预清洗的字段
  nameMaxLength: 4, // 查找最大的中文名字长度
}
// type参数0表示使用正则解析,1表示采用树查找, textFilter地址预清洗过滤字段。
const parseResult = AddressParse('your address', options)
// The parseResult is an object contain { province: '', name: '', city: '', area: '', detail: '', phone: '', postalCode: '' }

script引入

<script async defer src="./zh-address-parse.min.js"></script>
<script>
    const parse = () => {
        const onTextAreaBlur = (e) => {
            const address = e.target.value
            const parseResult = window.ZhAddressParse(address, { type: 0, textFilter: ['电話', '電話', '聯系人'] })
            // The parseResult is an object contain { province: '', name: '', city: '', area: '', detail: '', phone: '', postalCode: '' }
            console.log(parseResult)
            $('#result').empty();
            $('#result').append(`<ul>${Object.entries(parseResult).map(([k, v]) => `<li>${k}${v}</li>`).join('')}</ul>`)
        }
        $('#addressContent').bind('input propertychange', onTextAreaBlur)

        $('#addressList li').on('click', (e) => {
            $('#addressContent').val(e.target.innerText)
            $('#addressContent')[0].dispatchEvent(new Event('input'));
        })
    }

    parse()
</script>

Setup

Install dependencies

$ npm install

Development

Run the local webpack-dev-server with livereload and autocompile on http://localhost:8080/

$ npm run dev

Deployment

Build the current application

$ npm run build

Donate

您的支持是我前进的动力,更好的支持开源事业!~

Developed with Open Source Licensed WebStorm

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].