From be20f774b7be28a6c8b5359351dc1907d7ac7da8 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 19 Mar 2016 09:01:55 -0400 Subject: Added vowel sound identification --- lib/word.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/word.cpp') 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 @@ #include "verbly.h" +#include namespace verbly { @@ -29,4 +30,11 @@ namespace verbly { return result; } + bool word::starts_with_vowel_sound() const + { + return std::any_of(std::begin(pronunciations), std::end(pronunciations), [] (std::list phonemes) { + return (phonemes.front().find_first_of("012") != std::string::npos); + }); + } + }; -- cgit 1.4.1