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

Allow overriding subject label language in CLI and REST suggest operations #630

Merged
merged 4 commits into from
Oct 7, 2022

Conversation

osma
Copy link
Member

@osma osma commented Oct 7, 2022

Fixes #628

This PR implements an option --language / -L for the annif suggest command as well as an optional language parameter for the REST API suggest method, both of which allow overriding the language of returned subject labels.

TODO:

  • error handling: don't break if the given language is broken or not available in the vocabulary
  • implement the --language option for the annif index command as well
  • address QA tool complaints

@osma osma self-assigned this Oct 7, 2022
@osma osma added this to the 0.60 milestone Oct 7, 2022
@codecov
Copy link

codecov bot commented Oct 7, 2022

Codecov Report

Base: 99.61% // Head: 99.58% // Decreases project coverage by -0.03% ⚠️

Coverage data is based on head (3cfcac8) compared to base (597e67e).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #630      +/-   ##
==========================================
- Coverage   99.61%   99.58%   -0.04%     
==========================================
  Files          87       87              
  Lines        5945     5990      +45     
==========================================
+ Hits         5922     5965      +43     
- Misses         23       25       +2     
Impacted Files Coverage Δ
annif/cli.py 99.68% <100.00%> (+<0.01%) ⬆️
annif/rest.py 96.22% <100.00%> (-3.78%) ⬇️
tests/test_cli.py 100.00% <100.00%> (ø)
tests/test_rest.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@osma osma force-pushed the issue628-suggest-language branch from 552b5d0 to 3cfcac8 Compare October 7, 2022 14:12
@sonarcloud
Copy link

sonarcloud bot commented Oct 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@osma osma marked this pull request as ready for review October 7, 2022 14:20
@osma osma requested a review from juhoinkinen October 7, 2022 14:20
Copy link
Member

@juhoinkinen juhoinkinen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@osma osma merged commit 7ec5d64 into master Oct 7, 2022
@osma osma deleted the issue628-suggest-language branch October 7, 2022 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow selecting label language in suggest operations
2 participants