diff options
Diffstat (limited to 'generator/generator.h')
-rw-r--r-- | generator/generator.h | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/generator/generator.h b/generator/generator.h index c829c21..8352693 100644 --- a/generator/generator.h +++ b/generator/generator.h | |||
@@ -16,17 +16,17 @@ | |||
16 | #include "frame.h" | 16 | #include "frame.h" |
17 | 17 | ||
18 | namespace verbly { | 18 | namespace verbly { |
19 | 19 | ||
20 | enum class part_of_speech; | 20 | enum class part_of_speech; |
21 | class selrestr; | 21 | class selrestr; |
22 | 22 | ||
23 | namespace generator { | 23 | namespace generator { |
24 | 24 | ||
25 | class generator { | 25 | class generator { |
26 | public: | 26 | public: |
27 | 27 | ||
28 | // Constructor | 28 | // Constructor |
29 | 29 | ||
30 | generator( | 30 | generator( |
31 | std::string verbNetPath, | 31 | std::string verbNetPath, |
32 | std::string agidPath, | 32 | std::string agidPath, |
@@ -34,95 +34,95 @@ namespace verbly { | |||
34 | std::string cmudictPath, | 34 | std::string cmudictPath, |
35 | std::string imageNetPath, | 35 | std::string imageNetPath, |
36 | std::string outputPath); | 36 | std::string outputPath); |
37 | 37 | ||
38 | // Action | 38 | // Action |
39 | 39 | ||
40 | void run(); | 40 | void run(); |
41 | 41 | ||
42 | private: | 42 | private: |
43 | 43 | ||
44 | // Subroutines | 44 | // Subroutines |
45 | 45 | ||
46 | void readWordNetSynsets(); | 46 | void readWordNetSynsets(); |
47 | 47 | ||
48 | void readAdjectivePositioning(); | 48 | void readAdjectivePositioning(); |
49 | 49 | ||
50 | void readImageNetUrls(); | 50 | void readImageNetUrls(); |
51 | 51 | ||
52 | void readWordNetSenseKeys(); | 52 | void readWordNetSenseKeys(); |
53 | 53 | ||
54 | void readVerbNet(); | 54 | void readVerbNet(); |
55 | 55 | ||
56 | void readAgidInflections(); | 56 | void readAgidInflections(); |
57 | 57 | ||
58 | void readPrepositions(); | 58 | void readPrepositions(); |
59 | 59 | ||
60 | void readCmudictPronunciations(); | 60 | void readCmudictPronunciations(); |
61 | 61 | ||
62 | void writeSchema(); | 62 | void writeSchema(); |
63 | 63 | ||
64 | void dumpObjects(); | 64 | void dumpObjects(); |
65 | 65 | ||
66 | void readWordNetAntonymy(); | 66 | void readWordNetAntonymy(); |
67 | 67 | ||
68 | void readWordNetVariation(); | 68 | void readWordNetVariation(); |
69 | 69 | ||
70 | void readWordNetClasses(); | 70 | void readWordNetClasses(); |
71 | 71 | ||
72 | void readWordNetCausality(); | 72 | void readWordNetCausality(); |
73 | 73 | ||
74 | void readWordNetEntailment(); | 74 | void readWordNetEntailment(); |
75 | 75 | ||
76 | void readWordNetHypernymy(); | 76 | void readWordNetHypernymy(); |
77 | 77 | ||
78 | void readWordNetInstantiation(); | 78 | void readWordNetInstantiation(); |
79 | 79 | ||
80 | void readWordNetMemberMeronymy(); | 80 | void readWordNetMemberMeronymy(); |
81 | 81 | ||
82 | void readWordNetPartMeronymy(); | 82 | void readWordNetPartMeronymy(); |
83 | 83 | ||
84 | void readWordNetSubstanceMeronymy(); | 84 | void readWordNetSubstanceMeronymy(); |
85 | 85 | ||
86 | void readWordNetPertainymy(); | 86 | void readWordNetPertainymy(); |
87 | 87 | ||
88 | void readWordNetSpecification(); | 88 | void readWordNetSpecification(); |
89 | 89 | ||
90 | void readWordNetSimilarity(); | 90 | void readWordNetSimilarity(); |
91 | 91 | ||
92 | // Helpers | 92 | // Helpers |
93 | 93 | ||
94 | std::list<std::string> readFile(std::string path); | 94 | std::list<std::string> readFile(std::string path); |
95 | 95 | ||
96 | inline part_of_speech partOfSpeechByWnid(int wnid); | 96 | inline part_of_speech partOfSpeechByWnid(int wnid); |
97 | 97 | ||
98 | notion& createNotion(part_of_speech partOfSpeech); | 98 | notion& createNotion(part_of_speech partOfSpeech); |
99 | 99 | ||
100 | notion& lookupOrCreateNotion(int wnid); | 100 | notion& lookupOrCreateNotion(int wnid); |
101 | 101 | ||
102 | lemma& lookupOrCreateLemma(std::string base_form); | 102 | lemma& lookupOrCreateLemma(std::string base_form); |
103 | 103 | ||
104 | form& lookupOrCreateForm(std::string text); | 104 | form& lookupOrCreateForm(std::string text); |
105 | 105 | ||
106 | template <typename... Args> word& createWord(Args&&... args); | 106 | template <typename... Args> word& createWord(Args&&... args); |
107 | 107 | ||
108 | group& createGroup(xmlNodePtr top); | 108 | group& createGroup(xmlNodePtr top); |
109 | 109 | ||
110 | selrestr parseSelrestr(xmlNodePtr top); | 110 | selrestr parseSelrestr(xmlNodePtr top); |
111 | 111 | ||
112 | // Input | 112 | // Input |
113 | 113 | ||
114 | std::string verbNetPath_; | 114 | std::string verbNetPath_; |
115 | std::string agidPath_; | 115 | std::string agidPath_; |
116 | std::string wordNetPath_; | 116 | std::string wordNetPath_; |
117 | std::string cmudictPath_; | 117 | std::string cmudictPath_; |
118 | std::string imageNetPath_; | 118 | std::string imageNetPath_; |
119 | 119 | ||
120 | // Output | 120 | // Output |
121 | 121 | ||
122 | database db_; | 122 | database db_; |
123 | 123 | ||
124 | // Data | 124 | // Data |
125 | 125 | ||
126 | std::list<notion> notions_; | 126 | std::list<notion> notions_; |
127 | std::list<word> words_; | 127 | std::list<word> words_; |
128 | std::list<lemma> lemmas_; | 128 | std::list<lemma> lemmas_; |
@@ -130,22 +130,22 @@ namespace verbly { | |||
130 | std::list<pronunciation> pronunciations_; | 130 | std::list<pronunciation> pronunciations_; |
131 | std::list<frame> frames_; | 131 | std::list<frame> frames_; |
132 | std::list<group> groups_; | 132 | std::list<group> groups_; |
133 | 133 | ||
134 | // Indexes | 134 | // Indexes |
135 | 135 | ||
136 | std::map<int, notion*> notionByWnid_; | 136 | std::map<int, notion*> notionByWnid_; |
137 | std::map<int, std::set<word*>> wordsByWnid_; | 137 | std::map<int, std::set<word*>> wordsByWnid_; |
138 | std::map<std::pair<int, int>, word*> wordByWnidAndWnum_; | 138 | std::map<std::pair<int, int>, word*> wordByWnidAndWnum_; |
139 | std::map<std::string, std::set<word*>> wordsByBaseForm_; | 139 | std::map<std::string, std::set<word*>> wordsByBaseForm_; |
140 | std::map<std::string, lemma*> lemmaByBaseForm_; | 140 | std::map<std::string, lemma*> lemmaByBaseForm_; |
141 | std::map<std::string, form*> formByText_; | 141 | std::map<std::string, form*> formByText_; |
142 | 142 | ||
143 | // Caches | 143 | // Caches |
144 | 144 | ||
145 | std::map<std::string, word*> wnSenseKeys_; | 145 | std::map<std::string, word*> wnSenseKeys_; |
146 | 146 | ||
147 | }; | 147 | }; |
148 | 148 | ||
149 | }; | 149 | }; |
150 | }; | 150 | }; |
151 | 151 | ||