Skip to content

Commit

Permalink
Prove lexicons contains only valid IPA phonemes
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysonvirissimo committed Apr 28, 2024
1 parent a4bc879 commit 05bcc4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/medieval_latina_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@

describe "Lexicons files meet AWS Polly requirements" do
let(:lexicon_files) { Dir["lexicons/*.pls"] }
let(:valid_ipa_regex) { /b|d|[d͡ʒ]|ð|f|ɡ|h|j|k|l|m|n|ŋ|p|[ɹ]|s|[ʃ]|t|[t͡ʃ]|θ|v|w|z|[ʒ]|ə|ɚ|æ|[aɪ]|[aʊ]|ɑ|[eɪ]|ɝ|ɛ|i|ɪ|[oʊ]|ɔ|[ɔɪ]|u|ʊ|ʌ|ˈ|ˌ|\./ }

it "generates lexicon files" do
expect(lexicon_files).not_to be_empty
Expand Down Expand Up @@ -199,8 +200,7 @@
end
end

it "contains valid IPA characters in the <phoneme> elements" do
valid_ipa_regex = /\A[\p{L}\p{M}\p{N}\p{P}\p{S}\p{Z}]+\z/
it "contains only allowed IPA characters in the <phoneme> elements" do
lexicon_files.each do |file|
content = File.read(file)
doc = Nokogiri::XML(content)
Expand Down

0 comments on commit 05bcc4f

Please sign in to comment.