0

I have the following string in portuguese: calça

But when a use search using calca I need to convert to calça Is there a gem ou a dict I can use to convert non accents strings to words with correct accents in portuguese?

  • Typically this is part of a search library/engine. Are you using ElasticSearch or postgres or... something else? – melcher Sep 21 '21 at 20:46
  • For example, elasticsearch has many built-in 'normalizers' https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-normalizers.html, specifically their `asciifolding` https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-asciifolding-tokenfilter.html – melcher Sep 21 '21 at 20:50
  • Postgres supports `unaccent` https://stackoverflow.com/questions/13596638/function-to-remove-accents-in-postgresql – melcher Sep 21 '21 at 20:51

1 Answers1