Hacker News new | ask | show | jobs
by davidbarker 3807 days ago
Sorry — that'll be the search trying to get a singular term from a plural.

I've tagged the images with singular terms to make them easier to search, so it will change terms like "bridges" to "bridge", or "men" to "man", unless I override each term. If anyone can suggest a better way, I'd be very grateful.

I'll add "Australia" as an override, for now. Thanks for pointing it out.

3 comments

Have you looked into using stemming?

https://en.wikipedia.org/wiki/Stemming

Most major languages should have a library available to handle this for you.

Instead of changing the search term directly, you can silently search for both.

Alternatively, you can use the Levenshtein distance to find words close to the search term (like its singular form).

stemming will be baked in to a search engine, for example elasticsearch or solr dependent on the language analyzer you use and how you map your fields.