summary refs log tree commit diff stats
path: root/lib/word.cpp
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2016-03-19 09:01:55 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2016-03-19 09:01:55 -0400
commitbe20f774b7be28a6c8b5359351dc1907d7ac7da8 (patch)
tree2045eb38b1fcd09d9bf9f09cc62dec2eaebe8997 /lib/word.cpp
parent365dda7937dae0b6edef1f498473c57c715eec1d (diff)
downloadverbly-be20f774b7be28a6c8b5359351dc1907d7ac7da8.tar.gz
verbly-be20f774b7be28a6c8b5359351dc1907d7ac7da8.tar.bz2
verbly-be20f774b7be28a6c8b5359351dc1907d7ac7da8.zip
Added vowel sound identification
Diffstat (limited to 'lib/word.cpp')
-rw-r--r--lib/word.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/word.cpp b/lib/word.cpp index c50e7d3..156e7e0 100644 --- a/lib/word.cpp +++ b/lib/word.cpp
@@ -1,4 +1,5 @@
1#include "verbly.h" 1#include "verbly.h"
2#include <algorithm>
2 3
3namespace verbly { 4namespace verbly {
4 5
@@ -29,4 +30,11 @@ namespace verbly {
29 return result; 30 return result;
30 } 31 }
31 32
33 bool word::starts_with_vowel_sound() const
34 {
35 return std::any_of(std::begin(pronunciations), std::end(pronunciations), [] (std::list<std::string> phonemes) {
36 return (phonemes.front().find_first_of("012") != std::string::npos);
37 });
38 }
39
32}; 40};