Skip to content

Commit 31891d4

Browse files
committed
Refactor locales by integrating transliteratio
- Refactored code for better readability and modularity, adding a new ABC for locales - Added transliteration support, including Latin transliteration, and integrated it into the library - Migrated country and language data to the nominatim_api for improved localization - Rewrote tests to use actual result objects instead of mocks - Integrated YAML configuration for language normalization and updated dependency management - Improved handling of optional dependencies and added GitHub workflows for testing them first pass in adding transliteration, still issues with searching Dandong Minor issue, realized also I need to add mock information about the Dandong database in order to test mypy fixed Testing linting fix Made from_accept_languages an abstract class, make display name and display name locale defined in base Changed from global to attribute, removed mock search updated .toml for dependenies fixed issue with display name with locales renaming and adding lang info file linting issues integrated yaml reading from config fixed issue with test normalization removed old locales class tried to add localize and localize results as abstract methods, had to change signature refactored code a bit, rewrote test to use actual result object not just mock restructured code for readablity, added a latin transliterator, however tests are failing on github that are not failing locally fixed mypy issues with base.py integrated latin transliteration for cleaner code made some comments better reverted back to original git ignore Dict to mapping change Double quotes to single quotes data country and language migration to api added optional dependencies add optional dependencies better job at optional imports lint Added data information in init Added more dependencies to fix import issue Trying to fix import Revert server glue Added fix for linter than is not on local machine Lint fighting linter added git workflow for optional dependencies trying agfain for optional linting again:( optional dependencies github again trying to fix opt dependencies 24 opt dep again lint
1 parent 196de9e commit 31891d4

File tree

18 files changed

+2029
-61
lines changed

18 files changed

+2029
-61
lines changed

.github/workflows/ci-tests.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,12 @@ jobs:
105105
LUA_VERSION: ${{ matrix.lua }}
106106

107107
- name: Install test prerequisites (apt)
108-
run: sudo apt-get install -y -qq python3-pytest python3-pytest-asyncio uvicorn python3-falcon python3-aiosqlite python3-pyosmium
108+
run: sudo apt-get install -y -qq python3-pytest python3-pytest-asyncio uvicorn python3-falcon python3-aiosqlite python3-pyosmium python3-unidecode
109109
if: matrix.dependencies == 'apt'
110110

111111
- name: Install test prerequisites (pip)
112-
run: ./venv/bin/pip install pytest-asyncio falcon starlette asgi_lifespan aiosqlite osmium uvicorn
112+
run: |
113+
./venv/bin/pip install pytest-asyncio falcon starlette asgi_lifespan aiosqlite osmium uvicorn cantonese-romanisation unidecode opencc
113114
if: matrix.dependencies == 'pip'
114115

115116
- name: Install test prerequisites

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ dist
1010
.coverage
1111

1212
.vagrant
13-
data/country_osm_grid.sql.gz
13+
data/country_osm_grid.sql.gz

packaging/nominatim-api/pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ dependencies = [
2323
]
2424
dynamic = ["version"]
2525

26+
[project.optional-dependencies]
27+
transliteration = [
28+
"cantonese-romanisation",
29+
"unidecode",
30+
"opencc"
31+
]
32+
2633
[project.urls]
2734
Homepage = "https://nominatim.org"
2835
Documentation = "https://nominatim.org/release-docs/latest/"

0 commit comments

Comments
 (0)