summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2016-03-27 14:30:14 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2016-03-27 14:30:14 -0400
commitb8e28a7bf24425e82defab415faf1d6cca9535f7 (patch)
tree281b3fa62dd5fb562c538079c8ae3863240df085
parent1b33b4c5fe509b6f516b906f4dcf6f0c91de1370 (diff)
downloadinsult-b8e28a7bf24425e82defab415faf1d6cca9535f7.tar.gz
insult-b8e28a7bf24425e82defab415faf1d6cca9535f7.tar.bz2
insult-b8e28a7bf24425e82defab415faf1d6cca9535f7.zip
Restricted word complexity, and tweaked the data
-rw-r--r--chemist.cpp6
-rw-r--r--data.txt73
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
4PRIMARY 4PRIMARY
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
14SECONDARY 15SECONDARY
15Developed in {year} due to the Great {Noun} Epidemic in {Region}. 16Developed due to the Great {Noun} Epidemic of {year} in {Region}.
16Frequently prescribed off-label for {syndrome}. 17Frequently prescribed off-label for {SYNDROME}.
17Sometimes used for {syndrome} because of its {verbing} effect. 18Sometimes used for {SYNDROME} because of its {verbing} effect.
18Illegal to own in the US because of its {verbing} effect. 19Illegal to own in the US because of its {verbing} effect.
19Developed in {year} to replace {EXISTENT}. 20Developed in {year} to replace {EXISTENT}.
20Overtook {EXISTENT} as the primary treatment, having fewer side effects. 21Overtook {EXISTENT} due to its {adjective} effect.
21Synthesized by {FamousName} in {year} in a {verbing} accident. 22Synthesized by {FamousName} in {year} in a {verbing} accident.
22Used mainly in {year}, before {EXISTENT} became popular. 23Used mainly in {year}, before {EXISTENT} became popular.
23Only legal in {Region} because of its {verbing} effect. 24Only legal in {Region} because of its {verbing} effect.
24 25
25SYNDROME 26SYNDROME
26Irritable {Noun} Syndrome 27irritable {noun} syndrome
27{Adjective} {Noun} Syndrome 28{adjective} {noun} syndrome
28Severe {Noun} 29severe {noun}
29Major {Adjective} Disorder 30major {adjective} disorder
30{Adjective} {Noun} Disorder 31{adjective} {noun} disorder
31Obsessive {Noun} Disorder 32obsessive {noun} disorder
32Clinical {Noun} 33clinical {noun}
33{Adjective} Personality Disorder 34{adjective} personality disorder
34Respiratory {Adjective} Disease 35respiratory {adjective} disease
35{Bodypart} Cancer 36{bodypart} cancer
36Restless {Bodypart} 37restless {bodypart}
37{Bodypart} Failure 38{bodypart} failure
38Congenital {Noun} Disease 39congenital {noun} disease
39{FamousName}'s disease 40{FamousName}'s disease
41{adjective} fever
42hypo{noun}ism
40 43
41CLASS 44CLASS
42analgesic 45analgesic
@@ -60,7 +63,7 @@ antifungal
60anti-infective 63anti-infective
61anti-inflammatory 64anti-inflammatory
62disinfectant 65disinfectant
63antispetic 66antiseptic
64antiemetic 67antiemetic
65diuretic 68diuretic
66opiod painkiller 69opiod painkiller
@@ -182,6 +185,17 @@ Estra
182Du 185Du
183Bus 186Bus
184Epin 187Epin
188Co
189Lido
190Pro
191Pri
192Bu
193Levo
194Ro
195Me
196Dibu
197Des
198Ha
185 199
186NAMEMID 200NAMEMID
187pipra 201pipra
@@ -208,6 +222,12 @@ thi
208loxe 222loxe
209con 223con
210epher 224epher
225piva
226bupi
227va
228piva
229flu
230oxy
211{NAMEMID}{NAMEMID} 231{NAMEMID}{NAMEMID}
212{NAMEMID}{NAMEMID} 232{NAMEMID}{NAMEMID}
213 233
@@ -234,4 +254,7 @@ um
234diol 254diol
235tin 255tin
236rone 256rone
237ine \ No newline at end of file 257ine
258caine
259rane
260ide \ No newline at end of file