]> git.openstreetmap.org Git - nominatim.git/commit
Rework word set computation
authorSarah Hoffmann <lonvia@denofr.de>
Sat, 29 Jun 2019 16:22:31 +0000 (18:22 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sat, 29 Jun 2019 16:22:31 +0000 (18:22 +0200)
commit38a99856c0ce34c47fa96a05720a3a77fc0fe092
tree0c3db1c58dc5f7dceebcebf8b3032258e53e2a66
parent09e7f0d013179471434afef07ce0ae9bcee6d1d8
Rework word set computation

Switch from an recursive algorithm for computing the word sets
to an iterative one that benefits from caching intermediate
results. This considerably reduces the amount of memory needed,
so that the depth restriction can be dropped. To ensure that
the number of word sets remains manageable, only sets up to
a certain length are accepted and only a certain number of
total word sets. If word sets need to be dropped, we drop
the ones with more words per word set first.

To further reduce the number of potential word sets, the valid
tokens are looked up first and then only word sets containing
valid tokens are computed.

Fixes #1403, #1404 and #654.
lib/Geocode.php
lib/Phrase.php
lib/TokenList.php
test/php/Nominatim/PhraseTest.php