diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-03-16 21:35:35 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-03-16 21:35:35 -0400 |
commit | 8b1333d0e6e2b9a5014bdbff2987d899f5413fee (patch) | |
tree | ab5c864b61cab267ad3118e8cbe637c151448aa5 /verbly/lib/word.cpp | |
parent | 3aceae8ab1eb5992110ea57a9479bbc3177feb21 (diff) | |
download | furries-8b1333d0e6e2b9a5014bdbff2987d899f5413fee.tar.gz furries-8b1333d0e6e2b9a5014bdbff2987d899f5413fee.tar.bz2 furries-8b1333d0e6e2b9a5014bdbff2987d899f5413fee.zip |
Added word derivational relationships (kind of eh at the moment) and moved verbly into its own directory
Diffstat (limited to 'verbly/lib/word.cpp')
-rw-r--r-- | verbly/lib/word.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/verbly/lib/word.cpp b/verbly/lib/word.cpp new file mode 100644 index 0000000..c50e7d3 --- /dev/null +++ b/verbly/lib/word.cpp | |||
@@ -0,0 +1,32 @@ | |||
1 | #include "verbly.h" | ||
2 | |||
3 | namespace verbly { | ||
4 | |||
5 | word::word(const data& _data, int _id) : _data(_data), _id(_id) | ||
6 | { | ||
7 | |||
8 | } | ||
9 | |||
10 | std::list<std::string> word::rhyme_phonemes() const | ||
11 | { | ||
12 | std::list<std::string> result; | ||
13 | |||
14 | for (auto pronunciation : pronunciations) | ||
15 | { | ||
16 | auto phemstrt = std::find_if(std::begin(pronunciation), std::end(pronunciation), [] (std::string phoneme) { | ||
17 | return phoneme.find("1") != std::string::npos; | ||
18 | }); | ||
19 | |||
20 | std::stringstream rhymer; | ||
21 | for (auto it = phemstrt; it != std::end(pronunciation); it++) | ||
22 | { | ||
23 | rhymer << " " << *it; | ||
24 | } | ||
25 | |||
26 | result.push_back(rhymer.str()); | ||
27 | } | ||
28 | |||
29 | return result; | ||
30 | } | ||
31 | |||
32 | }; | ||