Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Stemmer tests #25

Merged
merged 7 commits into from
Jul 18, 2022
Merged

Add Stemmer tests #25

merged 7 commits into from
Jul 18, 2022

Conversation

mateonunez
Copy link
Collaborator

Add stemmer tests. This PR closes #18 and improves the coverage.

Current (main) coverage:

 PASS  packages/lyra/tests/trie.test.ts
 PASS  packages/lyra/tests/utils.test.ts
 PASS  packages/lyra/tests/tokenizer.test.ts
 PASS  packages/lyra/tests/lyra.test.ts
-----------------|---------|----------|---------|---------|---------------------
File             | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s   
-----------------|---------|----------|---------|---------|---------------------
All files        |   91.97 |    79.34 |      90 |   93.28 |                     
 src             |   90.43 |    76.78 |   84.61 |   91.32 |                     
  errors.ts      |    82.6 |      100 |      50 |      75 | 8,20,23,26          
  levenshtein.ts |   91.66 |       60 |     100 |     100 | 2-3                 
  lyra.ts        |   93.69 |    78.78 |     100 |   94.54 | 127,164-167,182,193 
  stemmer.ts     |   76.92 |    72.72 |     100 |   76.92 | 22-23,43-44,49,56   
  tokenizer.ts   |     100 |      100 |     100 |     100 |                     
  utils.ts       |   94.73 |    83.33 |     100 |   94.73 | 30                  
 src/prefix-tree |   95.55 |    83.33 |     100 |    97.7 |                     
  node.ts        |     100 |      100 |     100 |     100 |                     
  trie.ts        |   94.59 |    83.33 |     100 |   97.18 | 121,146             
-----------------|---------|----------|---------|---------|---------------------

Coverage after the PR:

 PASS  packages/lyra/tests/utils.test.ts
 PASS  packages/lyra/tests/trie.test.ts
 PASS  packages/lyra/tests/stemmer.test.ts
 PASS  packages/lyra/tests/tokenizer.test.ts
 PASS  packages/lyra/tests/lyra.test.ts
-----------------|---------|----------|---------|---------|---------------------
File             | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s   
-----------------|---------|----------|---------|---------|---------------------
All files        |   93.31 |    81.31 |   90.24 |   94.68 |                     
 src             |   92.34 |       80 |   85.18 |   93.33 |                     
  errors.ts      |    82.6 |      100 |      50 |      75 | 8,20,23,26          
  levenshtein.ts |   91.66 |       60 |     100 |     100 | 2-3                 
  lyra.ts        |   93.69 |    78.78 |     100 |   94.54 | 127,164-167,182,193 
  stemmer.ts     |    92.3 |       90 |     100 |      92 | 49-50               
  tokenizer.ts   |     100 |      100 |     100 |     100 |                     
  utils.ts       |   94.73 |    83.33 |     100 |   94.73 | 30                  
 src/prefix-tree |   95.55 |    83.33 |     100 |    97.7 |                     
  node.ts        |     100 |      100 |     100 |     100 |                     
  trie.ts        |   94.59 |    83.33 |     100 |   97.18 | 121,146             
-----------------|---------|----------|---------|---------|---------------------

@micheleriva
Copy link
Member

Thank you so much! I just fear you need to fetch upstream, as I already added some tests for the stemmer in a previous commit 🙂

@mateonunez
Copy link
Collaborator Author

I think I did it here b32b138 🧐

Should I move stemmer tests into tokenizer tests?

@micheleriva
Copy link
Member

Oh, sorry! So, given that the stemmer has a dependency on the tokenizer, we can move all the tests into the tokenizer tests for now

@micheleriva micheleriva merged commit 5c60972 into oramasearch:main Jul 18, 2022
@mateonunez mateonunez deleted the fix/stemming-nl-es branch July 18, 2022 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error stemming in Dutch and Spanish
2 participants