Fuse: Add support for non-ASCII search

Created on 3 Feb 2017  路  7Comments  路  Source: krisk/Fuse

Hi all,

Currently, Fuse doesn't support searching through non-ASCII characters. For instance searching with stro on str枚mberg only matches str. This could be changed by

  • transliterating input to ASCII (e.g. stro -> stro)
  • transliterating all strings within an item to ASCII when evaluating that item (e.g. str枚mberg -> stromberg)
  • performing the match on the transliterated item (e.g. match [0,3])
  • returning original version item + matches (e.g. str枚mberg + match [0,3])

This code seems to have a pretty complete transliteration table (see char_map object):
https://github.com/pid/speakingurl/blob/master/lib/speakingurl.js

Not that I have a need for it at the moment, just bringing it up as a suggestion :)

Stale feature

Most helpful comment

"string".normalize('NFD').replace(/[\u0300-\u036f]/g, ""); would do it as part of a lexer

All 7 comments

"string".normalize('NFD').replace(/[\u0300-\u036f]/g, ""); would do it as part of a lexer

Any news about this feature ? Will it be implemented soon ? Thanks

Lots of people need it...

Would appreciate the inclusion of this feature. BTW awesome library!

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

Hi! Any news about this feature?

I think this should solve the issue:
https://github.com/krisk/Fuse/issues/415

It uses the diacritics library.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cekvenich picture cekvenich  路  4Comments

ibraheemdev picture ibraheemdev  路  3Comments

vexa picture vexa  路  4Comments

washtenawIdtreble picture washtenawIdtreble  路  4Comments

isiahmeadows picture isiahmeadows  路  3Comments