Skip to content

Commit

Permalink
Use first language from the list for automatic syllabification
Browse files Browse the repository at this point in the history
  • Loading branch information
Nianna committed Oct 11, 2024
1 parent 4fc8081 commit bd90a81
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public class SyllabizerContext {
public Optional<Syllabizer> findSyllabizer() {
return Optional.of(activeSongProperty.get())
.flatMap(song -> song.getTagValue(TagKey.LANGUAGE))
.map(value -> value.split(",")[0])
.map(String::strip)
.flatMap(Language::parse)
.map(language -> SYLLABIZERS.computeIfAbsent(language, this::createSyllabizer));
}
Expand Down

0 comments on commit bd90a81

Please sign in to comment.