diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-03-27 14:30:14 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-03-27 14:30:14 -0400 |
commit | b8e28a7bf24425e82defab415faf1d6cca9535f7 (patch) | |
tree | 281b3fa62dd5fb562c538079c8ae3863240df085 | |
parent | 1b33b4c5fe509b6f516b906f4dcf6f0c91de1370 (diff) | |
download | chemist-b8e28a7bf24425e82defab415faf1d6cca9535f7.tar.gz chemist-b8e28a7bf24425e82defab415faf1d6cca9535f7.tar.bz2 chemist-b8e28a7bf24425e82defab415faf1d6cca9535f7.zip |
Restricted word complexity, and tweaked the data
-rw-r--r-- | chemist.cpp | 6 | ||||
-rw-r--r-- | data.txt | 73 |
2 files changed, 51 insertions, 28 deletions
diff --git a/chemist.cpp b/chemist.cpp index 05cfac0..07120f8 100644 --- a/chemist.cpp +++ b/chemist.cpp | |||
@@ -75,10 +75,10 @@ int main(int argc, char** argv) | |||
75 | std::string result; | 75 | std::string result; |
76 | if (canontkn == "NOUN") | 76 | if (canontkn == "NOUN") |
77 | { | 77 | { |
78 | result = database.nouns().is_not_proper().random().limit(1).run().front().singular_form(); | 78 | result = database.nouns().is_not_proper().random().limit(1).with_complexity(1).run().front().singular_form(); |
79 | } else if (canontkn == "ADJECTIVE") | 79 | } else if (canontkn == "ADJECTIVE") |
80 | { | 80 | { |
81 | result = database.adjectives().random().limit(1).run().front().base_form(); | 81 | result = database.adjectives().with_complexity(1).random().limit(1).run().front().base_form(); |
82 | } else if (canontkn == "VERBING") | 82 | } else if (canontkn == "VERBING") |
83 | { | 83 | { |
84 | result = database.verbs().random().limit(1).run().front().ing_form(); | 84 | result = database.verbs().random().limit(1).run().front().ing_form(); |
@@ -101,7 +101,7 @@ int main(int argc, char** argv) | |||
101 | } else if (canontkn == "BODYPART") | 101 | } else if (canontkn == "BODYPART") |
102 | { | 102 | { |
103 | auto bp = database.nouns().with_singular_form("body part").limit(1).run().front(); | 103 | auto bp = database.nouns().with_singular_form("body part").limit(1).run().front(); |
104 | result = database.nouns().full_hyponym_of({bp}).random().limit(1).run().front().singular_form(); | 104 | result = database.nouns().full_hyponym_of({bp}).with_complexity(1).random().limit(1).run().front().singular_form(); |
105 | } else { | 105 | } else { |
106 | auto group = groups[canontkn]; | 106 | auto group = groups[canontkn]; |
107 | result = group[rand() % group.size()]; | 107 | result = group[rand() % group.size()]; |
diff --git a/data.txt b/data.txt index a98e594..8535d4e 100644 --- a/data.txt +++ b/data.txt | |||
@@ -2,41 +2,44 @@ MAIN | |||
2 | {PRIMARY} {SECONDARY} | 2 | {PRIMARY} {SECONDARY} |
3 | 3 | ||
4 | PRIMARY | 4 | PRIMARY |
5 | {NAME} is {CLASS:indefinite} commonly used to treat {syndrome}. | 5 | {NAME} is {CLASS:indefinite} commonly used to treat {SYNDROME}. |
6 | {NAME} is {CLASS:indefinite} primarily used for {syndrome}. | 6 | {NAME} is {CLASS:indefinite} primarily used for {SYNDROME}. |
7 | {NAME} is {CLASS:indefinite} prescribed for {syndrome}. | 7 | {NAME} is {CLASS:indefinite} prescribed for {SYNDROME}. |
8 | {NAME} is {CLASS:indefinite} approved for treatment of {syndrome}, {syndrome}, and {syndrome}. | 8 | {NAME} is {CLASS:indefinite} approved for treatment of {SYNDROME}, and {SYNDROME}. |
9 | {NAME} is {CLASS:indefinite} used for {syndrome} and {syndrome}. | 9 | {NAME} is {CLASS:indefinite} used for {SYNDROME} and {SYNDROME}. |
10 | {NAME} is {CLASS:indefinite} used with {existent} to treat {syndrome}. | 10 | {NAME} is {CLASS:indefinite} used with {EXISTENT} to treat {syndrome}. |
11 | {NAME} is {CLASS:indefinite} used in cases of {EXISTENT} overdose. | 11 | {NAME} is {CLASS:indefinite} used in cases of {EXISTENT} overdose. |
12 | {NAME} is {CLASS:indefinite} used recreationally as {CLASS:indefinite}. | 12 | {NAME} is {CLASS:indefinite} used recreationally as {CLASS:indefinite}. |
13 | {NAME} is {CLASS:indefinite} used recreationally for {verbing}. | ||
13 | 14 | ||
14 | SECONDARY | 15 | SECONDARY |
15 | Developed in {year} due to the Great {Noun} Epidemic in {Region}. | 16 | Developed due to the Great {Noun} Epidemic of {year} in {Region}. |
16 | Frequently prescribed off-label for {syndrome}. | 17 | Frequently prescribed off-label for {SYNDROME}. |
17 | Sometimes used for {syndrome} because of its {verbing} effect. | 18 | Sometimes used for {SYNDROME} because of its {verbing} effect. |
18 | Illegal to own in the US because of its {verbing} effect. | 19 | Illegal to own in the US because of its {verbing} effect. |
19 | Developed in {year} to replace {EXISTENT}. | 20 | Developed in {year} to replace {EXISTENT}. |
20 | Overtook {EXISTENT} as the primary treatment, having fewer side effects. | 21 | Overtook {EXISTENT} due to its {adjective} effect. |
21 | Synthesized by {FamousName} in {year} in a {verbing} accident. | 22 | Synthesized by {FamousName} in {year} in a {verbing} accident. |
22 | Used mainly in {year}, before {EXISTENT} became popular. | 23 | Used mainly in {year}, before {EXISTENT} became popular. |
23 | Only legal in {Region} because of its {verbing} effect. | 24 | Only legal in {Region} because of its {verbing} effect. |
24 | 25 | ||
25 | SYNDROME | 26 | SYNDROME |
26 | Irritable {Noun} Syndrome | 27 | irritable {noun} syndrome |
27 | {Adjective} {Noun} Syndrome | 28 | {adjective} {noun} syndrome |
28 | Severe {Noun} | 29 | severe {noun} |
29 | Major {Adjective} Disorder | 30 | major {adjective} disorder |
30 | {Adjective} {Noun} Disorder | 31 | {adjective} {noun} disorder |
31 | Obsessive {Noun} Disorder | 32 | obsessive {noun} disorder |
32 | Clinical {Noun} | 33 | clinical {noun} |
33 | {Adjective} Personality Disorder | 34 | {adjective} personality disorder |
34 | Respiratory {Adjective} Disease | 35 | respiratory {adjective} disease |
35 | {Bodypart} Cancer | 36 | {bodypart} cancer |
36 | Restless {Bodypart} | 37 | restless {bodypart} |
37 | {Bodypart} Failure | 38 | {bodypart} failure |
38 | Congenital {Noun} Disease | 39 | congenital {noun} disease |
39 | {FamousName}'s disease | 40 | {FamousName}'s disease |
41 | {adjective} fever | ||
42 | hypo{noun}ism | ||
40 | 43 | ||
41 | CLASS | 44 | CLASS |
42 | analgesic | 45 | analgesic |
@@ -60,7 +63,7 @@ antifungal | |||
60 | anti-infective | 63 | anti-infective |
61 | anti-inflammatory | 64 | anti-inflammatory |
62 | disinfectant | 65 | disinfectant |
63 | antispetic | 66 | antiseptic |
64 | antiemetic | 67 | antiemetic |
65 | diuretic | 68 | diuretic |
66 | opiod painkiller | 69 | opiod painkiller |
@@ -182,6 +185,17 @@ Estra | |||
182 | Du | 185 | Du |
183 | Bus | 186 | Bus |
184 | Epin | 187 | Epin |
188 | Co | ||
189 | Lido | ||
190 | Pro | ||
191 | Pri | ||
192 | Bu | ||
193 | Levo | ||
194 | Ro | ||
195 | Me | ||
196 | Dibu | ||
197 | Des | ||
198 | Ha | ||
185 | 199 | ||
186 | NAMEMID | 200 | NAMEMID |
187 | pipra | 201 | pipra |
@@ -208,6 +222,12 @@ thi | |||
208 | loxe | 222 | loxe |
209 | con | 223 | con |
210 | epher | 224 | epher |
225 | piva | ||
226 | bupi | ||
227 | va | ||
228 | piva | ||
229 | flu | ||
230 | oxy | ||
211 | {NAMEMID}{NAMEMID} | 231 | {NAMEMID}{NAMEMID} |
212 | {NAMEMID}{NAMEMID} | 232 | {NAMEMID}{NAMEMID} |
213 | 233 | ||
@@ -234,4 +254,7 @@ um | |||
234 | diol | 254 | diol |
235 | tin | 255 | tin |
236 | rone | 256 | rone |
237 | ine \ No newline at end of file | 257 | ine |
258 | caine | ||
259 | rane | ||
260 | ide \ No newline at end of file | ||