Skip to content

Commit

Permalink
excludeBrackets
Browse files Browse the repository at this point in the history
  • Loading branch information
pasqLisena committed Jan 27, 2020
1 parent d60ef6a commit c13f066
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'org.doremus'
version '0.5'
version '0.5.1'

apply plugin: 'java'
apply plugin: 'application'
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/org/doremus/string2vocabulary/VocabularyManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,16 @@ public static Resource searchInCategory(String label, String lang, List<Vocabula
concept = v.findConcept(label, false);
if (concept != null) return concept;
}
// third check: exclude brackets
for (Vocabulary v : category) {
concept = v.findConcept(langLabel, true, true);
if (concept != null) return concept;
}
// fourth check: exclude brackets + not caring about the language
for (Vocabulary v : category) {
concept = v.findConcept(langLabel, false, true);
if (concept != null) return concept;
}

// workaround: mi bemol => mi bemol majeur
if ("key".equals(category) && !label.endsWith("majeur")) {
Expand Down

0 comments on commit c13f066

Please sign in to comment.