Wikidata / soweego

Link Wikidata items to large catalogs
https://meta.wikimedia.org/wiki/Grants:Project/Hjfocs/soweego_2
GNU General Public License v3.0
95 stars 8 forks source link

Optimize quadratic runtime algorithm with tries/suffix trees #410

Open marfox opened 2 years ago

marfox commented 2 years ago

if this is a bottleneck you can make it faster via tries or suffix trees. a trie is rather easy to implement but limited to queries like a.startswith(b), while suffix trees are appropriate for full text search (pretty sure there's a library for that if you don't mind additional dependencies)

_Originally posted by @e-dorigatti in https://github.com/Wikidata/soweego/pull/405#discussion_r679783311_