diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-03-16 11:27:16 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-03-16 11:27:16 -0400 |
commit | 3aceae8ab1eb5992110ea57a9479bbc3177feb21 (patch) | |
tree | 13167a266805344efb7bb1d900486f782c23285e /verbly/token.cpp | |
parent | e1be2716746e75cf6ed37e86461a7f580a964564 (diff) | |
download | furries-3aceae8ab1eb5992110ea57a9479bbc3177feb21.tar.gz furries-3aceae8ab1eb5992110ea57a9479bbc3177feb21.tar.bz2 furries-3aceae8ab1eb5992110ea57a9479bbc3177feb21.zip |
Added more inflections, word relationships, and pronunciations
Nouns, adjectives, and adverbs now have inflected forms. A large number of WordNet word relationships (all noun-noun relationships, plus synonymy and antonymy for all word types except verbs) have been added. Additionally, CMUDICT is now being used to store word pronunciations for rhyming purposes. Verbly is now also a compiled library rather than being header-only due to the complexity of the query interface.
Diffstat (limited to 'verbly/token.cpp')
-rw-r--r-- | verbly/token.cpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/verbly/token.cpp b/verbly/token.cpp new file mode 100644 index 0000000..aa8f50e --- /dev/null +++ b/verbly/token.cpp | |||
@@ -0,0 +1,53 @@ | |||
1 | #include "verbly.h" | ||
2 | |||
3 | namespace verbly { | ||
4 | |||
5 | token::token(token::type _type) : _type(_type) | ||
6 | { | ||
7 | |||
8 | } | ||
9 | |||
10 | token::type token::token_type() const | ||
11 | { | ||
12 | return _type; | ||
13 | } | ||
14 | |||
15 | verb_token::verb_token(const class verb& _verb) : token(token::type::verb), _verb(&_verb) | ||
16 | { | ||
17 | |||
18 | } | ||
19 | |||
20 | const class verb& verb_token::verb() const | ||
21 | { | ||
22 | return *_verb; | ||
23 | } | ||
24 | |||
25 | verb_token& verb_token::inflect(verb_token::inflection infl) | ||
26 | { | ||
27 | _inflection = infl; | ||
28 | return *this; | ||
29 | } | ||
30 | |||
31 | bool verb_token::complete() const | ||
32 | { | ||
33 | return true; | ||
34 | } | ||
35 | |||
36 | std::string verb_token::compile() const | ||
37 | { | ||
38 | switch (_inflection) | ||
39 | { | ||
40 | case inflection::infinitive: return _verb->infinitive_form(); | ||
41 | case inflection::past_tense: return _verb->past_tense_form(); | ||
42 | case inflection::past_participle: return _verb->past_participle_form(); | ||
43 | case inflection::ing_form: return _verb->ing_form(); | ||
44 | case inflection::s_form: return _verb->s_form(); | ||
45 | } | ||
46 | } | ||
47 | |||
48 | token* verb_token::copy() const | ||
49 | { | ||
50 | return new verb_token(*this); | ||
51 | } | ||
52 | |||
53 | }; | ||