https://github.com/mrsuh/rent-parser
https://github.com/mrsuh/rent-parser
fasthttp golang socrent tomita
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/mrsuh/rent-parser
- Owner: mrsuh
- License: mit
- Created: 2017-04-19T08:35:50.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-09-03T06:44:02.000Z (almost 7 years ago)
- Last Synced: 2025-04-23T17:09:37.673Z (about 1 year ago)
- Topics: fasthttp, golang, socrent, tomita
- Language: C++
- Homepage: https://mrsuh.com/projects/socrent/
- Size: 1.67 MB
- Stars: 18
- Watchers: 1
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rent parser
## Quick start with Docker
```bash
docker run -p 9080:9080 -d mrsuh/rent-parser
curl -X POST -d 'сдаю двушку за 30 тыс в месяц' 'http://127.0.0.1:9080/parse'
{"type":2,"price":30000}
```
### Types
* 0 - комната
* 1 - 1 комнатная квартира
* 2 - 2 комнатная квартира
* 3 - 3 комнатная квартира
* 4 - 4+ комнатная квартира
## Compilation from source code
### Generate configs and load [Yandex Tomita parser](https://github.com/yandex/tomita-parser)
```bash
sh bin/deploy.sh
```
### Configure
* config/config.yml
* tomita/{price, type}/config.proto
### Compile
```bash
sh bin/compile.sh
```
### Run
```bash
bin/server /config/config.yml
```
## Tests
```bash
time python tests/test.py --parser-url 'http://127.0.0.1:9080' --test-file 'go/src/rent-parser/tests/tests.yml' --process-count 4
=== RESULT ===
Total tests: 8000
Valid types: 7475 (93.44%)
Valid prices: 5302 (66.28%)
real 35m23.099s
user 0m42.048s
sys 0m2.529s
```