Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

Letter 'A' variants not found by search #84

Open
bstrand opened this issue Apr 25, 2022 · 2 comments
Open

Letter 'A' variants not found by search #84

bstrand opened this issue Apr 25, 2022 · 2 comments

Comments

@bstrand
Copy link

bstrand commented Apr 25, 2022

Description

Characters that are variations on the letter 'A' are not found by search, whereas equivalent variations on other letters are.

Exception: Variants of alpha 'α' are not affected by this issue.

Examples

Working:
  1. Search: 'i grave'
  • Expected: ì igrave, Ì Igrave
  • Results: 6 glyphs, including igrave, Igrave
Not working:
  1. Search: 'a grave'
  • Expected: à agrave, À Agrave
  • Results: None
  1. Search: 'a ring'
  • Expected: å aring, Å Aring
  • Results: None
@bstrand
Copy link
Author

bstrand commented Apr 25, 2022

The problem is caused by code cleaning up the Glyph names when creating the index, wherein instances of the string ' a ' are removed.

          item.name
            .replace(/-[0-9]/g, '')
            .replace(' a ', '')
            .replace(' an ', ''),

This turns, e.g., "latin small letter a with ring above" into "latin small letterwith ring above". The resulting index thus does not yield results for "A …" searches on glyphs with "…letter a…" in the name. (Which, as observed, is inconsistent with other letters.)

Another problem here is that the leading and trailing spaces are both being removed, removing the boundary between the words before & after 'a', e.g. 'letterwith' above.

Will submit PR with a fix shortly.

@bstrand
Copy link
Author

bstrand commented Apr 25, 2022

Just to expand on the second thing with both spaces being stripped a bit (sorry, not filing a new issue), an example of what it breaks:
There is a glyph named x in a rectangle box. It is indexed as x inrectangle box, and thus is not found by searching for "rectangle" (but is found by searching for "inrectangle".)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant