Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/minmao-hub/mmlocationparser
国内地址提取出省市区街道等信息
https://github.com/minmao-hub/mmlocationparser
Last synced: 1 day ago
JSON representation
国内地址提取出省市区街道等信息
- Host: GitHub
- URL: https://github.com/minmao-hub/mmlocationparser
- Owner: MinMao-Hub
- Created: 2021-03-05T14:17:56.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-06T08:05:46.000Z (almost 4 years ago)
- Last Synced: 2024-11-05T19:59:39.491Z (about 2 months ago)
- Language: Objective-C
- Size: 558 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MMLocationParser
国内地址提取出省市区街道等信息### 概述
简单的地址字符串解析
### Usage
```
MMLocationParser *parser = [MMLocationParser parserWithLoation:@"上海市浦东新区金科路2000号"];
NSLog(@"输入:");
NSLog(@"%@",parser.location);
NSLog(@"输出:");
NSLog(@"province: %@",parser.province);
NSLog(@"city: %@",parser.city);
NSLog(@"area: %@",parser.area);
NSLog(@"town: %@",parser.town);
NSLog(@"street: %@",parser.street);
NSLog(@"name: %@",parser.name);
NSLog(@"results: %@",parser.results);
```### Example
* 单地址解析示例
![](images/shanghai.png)
![](images/anhui1.png)
* 批量地址解析示例
```
NSArray *list = [MMLocationParser parseList:@[
@"上海市浦东新区金科路2000号",
@"安徽省黄山市歙县桂林镇竦口村188号",
@"内蒙古自治区呼和浩特市新城区成吉思汗大街",
@"青海省果洛藏族自治州达日县麻河乡撒哈拉村999号",
@"香港特别行政区中西区薄扶林道",
]];for (MMLocationParser *parser in list) {
NSLog(@"input:%@",parser.location);
NSLog(@"province: %@",parser.province);
NSLog(@"city: %@",parser.city);
NSLog(@"area: %@",parser.area);
NSLog(@"town: %@",parser.town);
NSLog(@"street: %@",parser.street);
NSLog(@"name: %@",parser.name);
NSLog(@"results: %@",parser.results);
}
```![](images/batch.png)