latinirb 0.0.2 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.markdown CHANGED
@@ -12,11 +12,7 @@ form of a verb.
12
12
 
13
13
  An primary use case would be:
14
14
 
15
- ```ruby
16
- p @aFirst.active_voice_indicative_mood_present_tense_first_person_singular_number #=> amō
17
- p @aFirst.chart #=> ( a chart )
18
- p @aFirst.active_voice_indicative_mood_present_tense #=> ["amō", "amās", "amat", "amāmus", "amātis", "amant"]
19
- ```
15
+ @aFirst.active\_voice\_indicative\_mood\_present\_tense\_first\_person\_singular\_number #=> amō
20
16
 
21
17
  Upon opening the script, the student may play with verbs offered for
22
18
  exploration. These are the standard paradigmatics verbs presented in
@@ -35,14 +31,11 @@ Wheelock:
35
31
 
36
32
  Because LatinVerb attempts to preserve the phonographic data of a Latin verb,
37
33
  the quantity of the vowels, the LatinVerb-definining string _must_ contain the
38
- macron data so that the heuristics work.
34
+ macron data so that the heuristics work. To this end, you may use
35
+ MacronConversions to convert ASCII TeX-style transliterations of macronized
36
+ vowels to produce the correct string:
39
37
 
40
- To this end, you may use
41
- [MacronConversions](https://github.com/sgharms/Macronconversions) to convert
42
- ASCII TeX-style transliterations of macronized vowels to produce the correct
43
- string.
44
-
45
- lv = Linguistics::Latin::Verb::LatinVerb#new("amō amāre amāvī amatum"))
38
+ lv = LatinVerb.new(Text::Latex::Util::Macronconversions.convert('am\={o} am\={a}re am\={a}v\={i} amatum', :mc))
46
39
  lv.active\_voice\_indicative\_mood\_present\_tense\_first\_person\_singular\_number #=> amō
47
40
 
48
41
  ## VIEWING
@@ -53,10 +46,10 @@ that you use urxvt or Apple's Terminal.app for viewing these entries.
53
46
 
54
47
  ## GENERATING VERBS
55
48
 
56
- Typically, in the code I have used the macron-ized character because Vim and my Terminal of choice
49
+ Typically, in the code I have used the macron-ized character because Textmate and my Terminal of choice
57
50
  both understand it.
58
51
 
59
- LatinVerb#new %w(amō amāre amāvī amatum)
52
+ LatinVerb.new %w(amō amāre amāvī amatum)
60
53
 
61
54
  ## EXECUTING METHODS
62
55
 
@@ -65,8 +58,10 @@ number / and person
65
58
 
66
59
  ### CHART VIEW
67
60
 
68
- To view the chart of a verb, use `LatinVerb#chart`. This is a basic chart that
69
- will look familiar to students.
61
+ *Currently Unimplemented: 1 June 2011: Implementation underway*
62
+
63
+ To view the chart of a verb, use LatinVerb.chart\_display. This is a basic
64
+ chart that will look familiar to students.
70
65
 
71
66
  ### SINGULAR VECTOR
72
67
 
@@ -80,170 +75,166 @@ an exhaustive list of options follows below.
80
75
  ### MULTIPLEX VECTORS
81
76
 
82
77
  Several convenience methods exist which load multiple tenses at the same time such as "present system" or "perfect system". These
83
- methods load the tenses into the @collections iVar associated with the LatinVerb# This value can be accessed as @collections
78
+ methods load the tenses into the @collections iVar associated with the LatinVerb. This value can be accessed as @collections
84
79
  is shared per attr\_reader
85
80
 
86
- ### CHART VIEW
87
-
88
- By using the LatinDisplay.chart\_view, a chart, much like what is found in verb references can be had for the verb. This is a
89
- _very_ handy method.
90
81
 
91
82
  ### Comprehensive List of Singular Vectors
92
83
 
93
- * LatinVerb#active\_voice\_indicative\_mood\_present\_tense\_first\_person\_singular\_number
94
- * LatinVerb#active\_voice\_indicative\_mood\_present\_tense\_second\_person\_singular\_number
95
- * LatinVerb#active\_voice\_indicative\_mood\_present\_tense\_third\_person\_singular\_number
96
- * LatinVerb#active\_voice\_indicative\_mood\_present\_tense\_first\_person\_plural\_number
97
- * LatinVerb#active\_voice\_indicative\_mood\_present\_tense\_second\_person\_plural\_number
98
- * LatinVerb#active\_voice\_indicative\_mood\_present\_tense\_third\_person\_plural\_number
99
-
100
- * LatinVerb#active\_voice\_indicative\_mood\_imperfect\_tense\_first\_person\_singular\_number
101
- * LatinVerb#active\_voice\_indicative\_mood\_imperfect\_tense\_second\_person\_singular\_number
102
- * LatinVerb#active\_voice\_indicative\_mood\_imperfect\_tense\_third\_person\_singular\_number
103
- * LatinVerb#active\_voice\_indicative\_mood\_imperfect\_tense\_first\_person\_plural\_number
104
- * LatinVerb#active\_voice\_indicative\_mood\_imperfect\_tense\_second\_person\_plural\_number
105
- * LatinVerb#active\_voice\_indicative\_mood\_imperfect\_tense\_third\_person\_plural\_number
106
-
107
- * LatinVerb#active\_voice\_indicative\_mood\_future\_tense\_first\_person\_singular\_number
108
- * LatinVerb#active\_voice\_indicative\_mood\_future\_tense\_second\_person\_singular\_number
109
- * LatinVerb#active\_voice\_indicative\_mood\_future\_tense\_third\_person\_singular\_number
110
- * LatinVerb#active\_voice\_indicative\_mood\_future\_tense\_first\_person\_plural\_number
111
- * LatinVerb#active\_voice\_indicative\_mood\_future\_tense\_second\_person\_plural\_number
112
- * LatinVerb#active\_voice\_indicative\_mood\_future\_tense\_third\_person\_plural\_number
113
-
114
- * LatinVerb#active\_voice\_indicative\_mood\_perfect\_tense\_first\_person\_singular\_number
115
- * LatinVerb#active\_voice\_indicative\_mood\_perfect\_tense\_second\_person\_singular\_number
116
- * LatinVerb#active\_voice\_indicative\_mood\_perfect\_tense\_third\_person\_singular\_number
117
- * LatinVerb#active\_voice\_indicative\_mood\_perfect\_tense\_first\_person\_plural\_number
118
- * LatinVerb#active\_voice\_indicative\_mood\_perfect\_tense\_second\_person\_plural\_number
119
- * LatinVerb#active\_voice\_indicative\_mood\_perfect\_tense\_third\_person\_plural\_number
120
-
121
- * LatinVerb#active\_voice\_indicative\_mood\_pastperfect\_tense\_first\_person\_singular\_number
122
- * LatinVerb#active\_voice\_indicative\_mood\_pastperfect\_tense\_second\_person\_singular\_number
123
- * LatinVerb#active\_voice\_indicative\_mood\_pastperfect\_tense\_third\_person\_singular\_number
124
- * LatinVerb#active\_voice\_indicative\_mood\_pastperfect\_tense\_first\_person\_plural\_number
125
- * LatinVerb#active\_voice\_indicative\_mood\_pastperfect\_tense\_second\_person\_plural\_number
126
- * LatinVerb#active\_voice\_indicative\_mood\_pastperfect\_tense\_third\_person\_plural\_number
84
+ * LatinVerb.active\_voice\_indicative\_mood\_present\_tense\_first\_person\_singular\_number
85
+ * LatinVerb.active\_voice\_indicative\_mood\_present\_tense\_second\_person\_singular\_number
86
+ * LatinVerb.active\_voice\_indicative\_mood\_present\_tense\_third\_person\_singular\_number
87
+ * LatinVerb.active\_voice\_indicative\_mood\_present\_tense\_first\_person\_plural\_number
88
+ * LatinVerb.active\_voice\_indicative\_mood\_present\_tense\_second\_person\_plural\_number
89
+ * LatinVerb.active\_voice\_indicative\_mood\_present\_tense\_third\_person\_plural\_number
90
+
91
+ * LatinVerb.active\_voice\_indicative\_mood\_imperfect\_tense\_first\_person\_singular\_number
92
+ * LatinVerb.active\_voice\_indicative\_mood\_imperfect\_tense\_second\_person\_singular\_number
93
+ * LatinVerb.active\_voice\_indicative\_mood\_imperfect\_tense\_third\_person\_singular\_number
94
+ * LatinVerb.active\_voice\_indicative\_mood\_imperfect\_tense\_first\_person\_plural\_number
95
+ * LatinVerb.active\_voice\_indicative\_mood\_imperfect\_tense\_second\_person\_plural\_number
96
+ * LatinVerb.active\_voice\_indicative\_mood\_imperfect\_tense\_third\_person\_plural\_number
97
+
98
+ * LatinVerb.active\_voice\_indicative\_mood\_future\_tense\_first\_person\_singular\_number
99
+ * LatinVerb.active\_voice\_indicative\_mood\_future\_tense\_second\_person\_singular\_number
100
+ * LatinVerb.active\_voice\_indicative\_mood\_future\_tense\_third\_person\_singular\_number
101
+ * LatinVerb.active\_voice\_indicative\_mood\_future\_tense\_first\_person\_plural\_number
102
+ * LatinVerb.active\_voice\_indicative\_mood\_future\_tense\_second\_person\_plural\_number
103
+ * LatinVerb.active\_voice\_indicative\_mood\_future\_tense\_third\_person\_plural\_number
104
+
105
+ * LatinVerb.active\_voice\_indicative\_mood\_perfect\_tense\_first\_person\_singular\_number
106
+ * LatinVerb.active\_voice\_indicative\_mood\_perfect\_tense\_second\_person\_singular\_number
107
+ * LatinVerb.active\_voice\_indicative\_mood\_perfect\_tense\_third\_person\_singular\_number
108
+ * LatinVerb.active\_voice\_indicative\_mood\_perfect\_tense\_first\_person\_plural\_number
109
+ * LatinVerb.active\_voice\_indicative\_mood\_perfect\_tense\_second\_person\_plural\_number
110
+ * LatinVerb.active\_voice\_indicative\_mood\_perfect\_tense\_third\_person\_plural\_number
111
+
112
+ * LatinVerb.active\_voice\_indicative\_mood\_pastperfect\_tense\_first\_person\_singular\_number
113
+ * LatinVerb.active\_voice\_indicative\_mood\_pastperfect\_tense\_second\_person\_singular\_number
114
+ * LatinVerb.active\_voice\_indicative\_mood\_pastperfect\_tense\_third\_person\_singular\_number
115
+ * LatinVerb.active\_voice\_indicative\_mood\_pastperfect\_tense\_first\_person\_plural\_number
116
+ * LatinVerb.active\_voice\_indicative\_mood\_pastperfect\_tense\_second\_person\_plural\_number
117
+ * LatinVerb.active\_voice\_indicative\_mood\_pastperfect\_tense\_third\_person\_plural\_number
127
118
 
128
- * LatinVerb#active\_voice\_indicative\_mood\_futureperfect\_tense\_first\_person\_singular\_number
129
- * LatinVerb#active\_voice\_indicative\_mood\_futureperfect\_tense\_second\_person\_singular\_number
130
- * LatinVerb#active\_voice\_indicative\_mood\_futureperfect\_tense\_third\_person\_singular\_number
131
- * LatinVerb#active\_voice\_indicative\_mood\_futureperfect\_tense\_first\_person\_plural\_number
132
- * LatinVerb#active\_voice\_indicative\_mood\_futureperfect\_tense\_second\_person\_plural\_number
133
- * LatinVerb#active\_voice\_indicative\_mood\_futureperfect\_tense\_third\_person\_plural\_number
134
-
135
- * LatinVerb#passive\_voice\_indicative\_mood\_present\_tense\_first\_person\_singular\_number
136
- * LatinVerb#passive\_voice\_indicative\_mood\_present\_tense\_second\_person\_singular\_number
137
- * LatinVerb#passive\_voice\_indicative\_mood\_present\_tense\_third\_person\_singular\_number
138
- * LatinVerb#passive\_voice\_indicative\_mood\_present\_tense\_first\_person\_plural\_number
139
- * LatinVerb#passive\_voice\_indicative\_mood\_present\_tense\_second\_person\_plural\_number
140
- * LatinVerb#passive\_voice\_indicative\_mood\_present\_tense\_third\_person\_plural\_number
141
-
142
- * LatinVerb#passive\_voice\_indicative\_mood\_imperfect\_tense\_first\_person\_singular\_number
143
- * LatinVerb#passive\_voice\_indicative\_mood\_imperfect\_tense\_second\_person\_singular\_number
144
- * LatinVerb#passive\_voice\_indicative\_mood\_imperfect\_tense\_third\_person\_singular\_number
145
- * LatinVerb#passive\_voice\_indicative\_mood\_imperfect\_tense\_first\_person\_plural\_number
146
- * LatinVerb#passive\_voice\_indicative\_mood\_imperfect\_tense\_second\_person\_plural\_number
147
- * LatinVerb#passive\_voice\_indicative\_mood\_imperfect\_tense\_third\_person\_plural\_number
148
-
149
- * LatinVerb#passive\_voice\_indicative\_mood\_future\_tense\_first\_person\_singular\_number
150
- * LatinVerb#passive\_voice\_indicative\_mood\_future\_tense\_second\_person\_singular\_number
151
- * LatinVerb#passive\_voice\_indicative\_mood\_future\_tense\_third\_person\_singular\_number
152
- * LatinVerb#passive\_voice\_indicative\_mood\_future\_tense\_first\_person\_plural\_number
153
- * LatinVerb#passive\_voice\_indicative\_mood\_future\_tense\_second\_person\_plural\_number
154
- * LatinVerb#passive\_voice\_indicative\_mood\_future\_tense\_third\_person\_plural\_number
155
-
156
- * LatinVerb#passive\_voice\_indicative\_mood\_perfect\_tense\_first\_person\_singular\_number
157
- * LatinVerb#passive\_voice\_indicative\_mood\_perfect\_tense\_second\_person\_singular\_number
158
- * LatinVerb#passive\_voice\_indicative\_mood\_perfect\_tense\_third\_person\_singular\_number
159
- * LatinVerb#passive\_voice\_indicative\_mood\_perfect\_tense\_first\_person\_plural\_number
160
- * LatinVerb#passive\_voice\_indicative\_mood\_perfect\_tense\_second\_person\_plural\_number
161
- * LatinVerb#passive\_voice\_indicative\_mood\_perfect\_tense\_third\_person\_plural\_number.to\_s)
162
-
163
- * LatinVerb#passive\_voice\_indicative\_mood\_pastperfect\_tense\_first\_person\_singular\_number
164
- * LatinVerb#passive\_voice\_indicative\_mood\_pastperfect\_tense\_second\_person\_singular\_number
165
- * LatinVerb#passive\_voice\_indicative\_mood\_pastperfect\_tense\_third\_person\_singular\_number
166
- * LatinVerb#passive\_voice\_indicative\_mood\_pastperfect\_tense\_first\_person\_plural\_number
167
- * LatinVerb#passive\_voice\_indicative\_mood\_pastperfect\_tense\_second\_person\_plural\_number
168
- * LatinVerb#passive\_voice\_indicative\_mood\_pastperfect\_tense\_third\_person\_plural\_number.to\_s)
169
-
170
- * LatinVerb#passive\_voice\_indicative\_mood\_futureperfect\_tense\_first\_person\_singular\_number
171
- * LatinVerb#passive\_voice\_indicative\_mood\_futureperfect\_tense\_second\_person\_singular\_number
172
- * LatinVerb#passive\_voice\_indicative\_mood\_futureperfect\_tense\_third\_person\_singular\_number
173
- * LatinVerb#passive\_voice\_indicative\_mood\_futureperfect\_tense\_first\_person\_plural\_number
174
- * LatinVerb#passive\_voice\_indicative\_mood\_futureperfect\_tense\_second\_person\_plural\_number
175
- * LatinVerb#passive\_voice\_indicative\_mood\_futureperfect\_tense\_third\_person\_plural\_number
176
-
177
-
178
- * LatinVerb#active\_voice\_subjunctive\_mood\_present\_tense\_first\_person\_singular\_number
179
- * LatinVerb#active\_voice\_subjunctive\_mood\_present\_tense\_second\_person\_singular\_number
180
- * LatinVerb#active\_voice\_subjunctive\_mood\_present\_tense\_third\_person\_singular\_number
181
- * LatinVerb#active\_voice\_subjunctive\_mood\_present\_tense\_first\_person\_plural\_number
182
- * LatinVerb#active\_voice\_subjunctive\_mood\_present\_tense\_second\_person\_plural\_number
183
- * LatinVerb#active\_voice\_subjunctive\_mood\_present\_tense\_third\_person\_plural\_number
184
-
185
- * LatinVerb#active\_voice\_subjunctive\_mood\_imperfect\_tense\_first\_person\_singular\_number
186
- * LatinVerb#active\_voice\_subjunctive\_mood\_imperfect\_tense\_second\_person\_singular\_number
187
- * LatinVerb#active\_voice\_subjunctive\_mood\_imperfect\_tense\_third\_person\_singular\_number
188
- * LatinVerb#active\_voice\_subjunctive\_mood\_imperfect\_tense\_first\_person\_plural\_number
189
- * LatinVerb#active\_voice\_subjunctive\_mood\_imperfect\_tense\_second\_person\_plural\_number
190
- * LatinVerb#active\_voice\_subjunctive\_mood\_imperfect\_tense\_third\_person\_plural\_number
191
-
192
- * LatinVerb#active\_voice\_subjunctive\_mood\_perfect\_tense\_first\_person\_singular\_number
193
- * LatinVerb#active\_voice\_subjunctive\_mood\_perfect\_tense\_second\_person\_singular\_number
194
- * LatinVerb#active\_voice\_subjunctive\_mood\_perfect\_tense\_third\_person\_singular\_number
195
- * LatinVerb#active\_voice\_subjunctive\_mood\_perfect\_tense\_first\_person\_plural\_number
196
- * LatinVerb#active\_voice\_subjunctive\_mood\_perfect\_tense\_second\_person\_plural\_number
197
- * LatinVerb#active\_voice\_subjunctive\_mood\_perfect\_tense\_third\_person\_plural\_number
198
-
199
- * LatinVerb#active\_voice\_subjunctive\_mood\_pastperfect\_tense\_first\_person\_singular\_number
200
- * LatinVerb#active\_voice\_subjunctive\_mood\_pastperfect\_tense\_second\_person\_singular\_number
201
- * LatinVerb#active\_voice\_subjunctive\_mood\_pastperfect\_tense\_third\_person\_singular\_number
202
- * LatinVerb#active\_voice\_subjunctive\_mood\_pastperfect\_tense\_first\_person\_plural\_number
203
- * LatinVerb#active\_voice\_subjunctive\_mood\_pastperfect\_tense\_second\_person\_plural\_number
204
- * LatinVerb#active\_voice\_subjunctive\_mood\_pastperfect\_tense\_third\_person\_plural\_number
205
-
206
- * LatinVerb#passive\_voice\_subjunctive\_mood\_present\_tense\_first\_person\_singular\_number
207
- * LatinVerb#passive\_voice\_subjunctive\_mood\_present\_tense\_second\_person\_singular\_number
208
- * LatinVerb#passive\_voice\_subjunctive\_mood\_present\_tense\_third\_person\_singular\_number
209
- * LatinVerb#passive\_voice\_subjunctive\_mood\_present\_tense\_first\_person\_plural\_number
210
- * LatinVerb#passive\_voice\_subjunctive\_mood\_present\_tense\_second\_person\_plural\_number
211
- * LatinVerb#passive\_voice\_subjunctive\_mood\_present\_tense\_third\_person\_plural\_number
212
-
213
- * LatinVerb#passive\_voice\_subjunctive\_mood\_imperfect\_tense\_first\_person\_singular\_number
214
- * LatinVerb#passive\_voice\_subjunctive\_mood\_imperfect\_tense\_second\_person\_singular\_number
215
- * LatinVerb#passive\_voice\_subjunctive\_mood\_imperfect\_tense\_third\_person\_singular\_number
216
- * LatinVerb#passive\_voice\_subjunctive\_mood\_imperfect\_tense\_first\_person\_plural\_number
217
- * LatinVerb#passive\_voice\_subjunctive\_mood\_imperfect\_tense\_second\_person\_plural\_number
218
- * LatinVerb#passive\_voice\_subjunctive\_mood\_imperfect\_tense\_third\_person\_plural\_number
219
-
220
- * LatinVerb#passive\_voice\_subjunctive\_mood\_perfect\_tense\_first\_person\_singular\_number
221
- * LatinVerb#passive\_voice\_subjunctive\_mood\_perfect\_tense\_second\_person\_singular\_number
222
- * LatinVerb#passive\_voice\_subjunctive\_mood\_perfect\_tense\_third\_person\_singular\_number
223
- * LatinVerb#passive\_voice\_subjunctive\_mood\_perfect\_tense\_first\_person\_plural\_number
224
- * LatinVerb#passive\_voice\_subjunctive\_mood\_perfect\_tense\_second\_person\_plural\_number
225
- * LatinVerb#passive\_voice\_subjunctive\_mood\_perfect\_tense\_third\_person\_plural\_number
226
-
227
- * LatinVerb#passive\_voice\_subjunctive\_mood\_pastperfect\_tense\_first\_person\_singular\_number
228
- * LatinVerb#passive\_voice\_subjunctive\_mood\_pastperfect\_tense\_second\_person\_singular\_number
229
- * LatinVerb#passive\_voice\_subjunctive\_mood\_pastperfect\_tense\_third\_person\_singular\_number
230
- * LatinVerb#passive\_voice\_subjunctive\_mood\_pastperfect\_tense\_first\_person\_plural\_number
231
- * LatinVerb#passive\_voice\_subjunctive\_mood\_pastperfect\_tense\_second\_person\_plural\_number
232
- * LatinVerb#passive\_voice\_subjunctive\_mood\_pastperfect\_tense\_third\_person\_plural\_number
233
-
234
- * LatinVerb#imperatives[0]
235
- * LatinVerb#imperatives[1]
236
-
237
- * LatinVerb#present\_active\_participle
238
- * LatinVerb#future\_active\_participle
239
- * LatinVerb#perfect\_passive\_participle
240
- * LatinVerb#future\_passive\_participle
241
-
242
- * LatinVerb#present\_active\_infinitive
243
- * LatinVerb#perfect\_active\_infinitive
244
- * LatinVerb#future\_active\_infinitive
245
- * LatinVerb#present\_passive\_infinitive
246
- * LatinVerb#perfect\_passive\_infinitive)
119
+ * LatinVerb.active\_voice\_indicative\_mood\_futureperfect\_tense\_first\_person\_singular\_number
120
+ * LatinVerb.active\_voice\_indicative\_mood\_futureperfect\_tense\_second\_person\_singular\_number
121
+ * LatinVerb.active\_voice\_indicative\_mood\_futureperfect\_tense\_third\_person\_singular\_number
122
+ * LatinVerb.active\_voice\_indicative\_mood\_futureperfect\_tense\_first\_person\_plural\_number
123
+ * LatinVerb.active\_voice\_indicative\_mood\_futureperfect\_tense\_second\_person\_plural\_number
124
+ * LatinVerb.active\_voice\_indicative\_mood\_futureperfect\_tense\_third\_person\_plural\_number
125
+
126
+ * LatinVerb.passive\_voice\_indicative\_mood\_present\_tense\_first\_person\_singular\_number
127
+ * LatinVerb.passive\_voice\_indicative\_mood\_present\_tense\_second\_person\_singular\_number
128
+ * LatinVerb.passive\_voice\_indicative\_mood\_present\_tense\_third\_person\_singular\_number
129
+ * LatinVerb.passive\_voice\_indicative\_mood\_present\_tense\_first\_person\_plural\_number
130
+ * LatinVerb.passive\_voice\_indicative\_mood\_present\_tense\_second\_person\_plural\_number
131
+ * LatinVerb.passive\_voice\_indicative\_mood\_present\_tense\_third\_person\_plural\_number
132
+
133
+ * LatinVerb.passive\_voice\_indicative\_mood\_imperfect\_tense\_first\_person\_singular\_number
134
+ * LatinVerb.passive\_voice\_indicative\_mood\_imperfect\_tense\_second\_person\_singular\_number
135
+ * LatinVerb.passive\_voice\_indicative\_mood\_imperfect\_tense\_third\_person\_singular\_number
136
+ * LatinVerb.passive\_voice\_indicative\_mood\_imperfect\_tense\_first\_person\_plural\_number
137
+ * LatinVerb.passive\_voice\_indicative\_mood\_imperfect\_tense\_second\_person\_plural\_number
138
+ * LatinVerb.passive\_voice\_indicative\_mood\_imperfect\_tense\_third\_person\_plural\_number
139
+
140
+ * LatinVerb.passive\_voice\_indicative\_mood\_future\_tense\_first\_person\_singular\_number
141
+ * LatinVerb.passive\_voice\_indicative\_mood\_future\_tense\_second\_person\_singular\_number
142
+ * LatinVerb.passive\_voice\_indicative\_mood\_future\_tense\_third\_person\_singular\_number
143
+ * LatinVerb.passive\_voice\_indicative\_mood\_future\_tense\_first\_person\_plural\_number
144
+ * LatinVerb.passive\_voice\_indicative\_mood\_future\_tense\_second\_person\_plural\_number
145
+ * LatinVerb.passive\_voice\_indicative\_mood\_future\_tense\_third\_person\_plural\_number
146
+
147
+ * LatinVerb.passive\_voice\_indicative\_mood\_perfect\_tense\_first\_person\_singular\_number
148
+ * LatinVerb.passive\_voice\_indicative\_mood\_perfect\_tense\_second\_person\_singular\_number
149
+ * LatinVerb.passive\_voice\_indicative\_mood\_perfect\_tense\_third\_person\_singular\_number
150
+ * LatinVerb.passive\_voice\_indicative\_mood\_perfect\_tense\_first\_person\_plural\_number
151
+ * LatinVerb.passive\_voice\_indicative\_mood\_perfect\_tense\_second\_person\_plural\_number
152
+ * LatinVerb.passive\_voice\_indicative\_mood\_perfect\_tense\_third\_person\_plural\_number.to\_s)
153
+
154
+ * LatinVerb.passive\_voice\_indicative\_mood\_pastperfect\_tense\_first\_person\_singular\_number
155
+ * LatinVerb.passive\_voice\_indicative\_mood\_pastperfect\_tense\_second\_person\_singular\_number
156
+ * LatinVerb.passive\_voice\_indicative\_mood\_pastperfect\_tense\_third\_person\_singular\_number
157
+ * LatinVerb.passive\_voice\_indicative\_mood\_pastperfect\_tense\_first\_person\_plural\_number
158
+ * LatinVerb.passive\_voice\_indicative\_mood\_pastperfect\_tense\_second\_person\_plural\_number
159
+ * LatinVerb.passive\_voice\_indicative\_mood\_pastperfect\_tense\_third\_person\_plural\_number.to\_s)
160
+
161
+ * LatinVerb.passive\_voice\_indicative\_mood\_futureperfect\_tense\_first\_person\_singular\_number
162
+ * LatinVerb.passive\_voice\_indicative\_mood\_futureperfect\_tense\_second\_person\_singular\_number
163
+ * LatinVerb.passive\_voice\_indicative\_mood\_futureperfect\_tense\_third\_person\_singular\_number
164
+ * LatinVerb.passive\_voice\_indicative\_mood\_futureperfect\_tense\_first\_person\_plural\_number
165
+ * LatinVerb.passive\_voice\_indicative\_mood\_futureperfect\_tense\_second\_person\_plural\_number
166
+ * LatinVerb.passive\_voice\_indicative\_mood\_futureperfect\_tense\_third\_person\_plural\_number
167
+
168
+
169
+ * LatinVerb.active\_voice\_subjunctive\_mood\_present\_tense\_first\_person\_singular\_number
170
+ * LatinVerb.active\_voice\_subjunctive\_mood\_present\_tense\_second\_person\_singular\_number
171
+ * LatinVerb.active\_voice\_subjunctive\_mood\_present\_tense\_third\_person\_singular\_number
172
+ * LatinVerb.active\_voice\_subjunctive\_mood\_present\_tense\_first\_person\_plural\_number
173
+ * LatinVerb.active\_voice\_subjunctive\_mood\_present\_tense\_second\_person\_plural\_number
174
+ * LatinVerb.active\_voice\_subjunctive\_mood\_present\_tense\_third\_person\_plural\_number
175
+
176
+ * LatinVerb.active\_voice\_subjunctive\_mood\_imperfect\_tense\_first\_person\_singular\_number
177
+ * LatinVerb.active\_voice\_subjunctive\_mood\_imperfect\_tense\_second\_person\_singular\_number
178
+ * LatinVerb.active\_voice\_subjunctive\_mood\_imperfect\_tense\_third\_person\_singular\_number
179
+ * LatinVerb.active\_voice\_subjunctive\_mood\_imperfect\_tense\_first\_person\_plural\_number
180
+ * LatinVerb.active\_voice\_subjunctive\_mood\_imperfect\_tense\_second\_person\_plural\_number
181
+ * LatinVerb.active\_voice\_subjunctive\_mood\_imperfect\_tense\_third\_person\_plural\_number
182
+
183
+ * LatinVerb.active\_voice\_subjunctive\_mood\_perfect\_tense\_first\_person\_singular\_number
184
+ * LatinVerb.active\_voice\_subjunctive\_mood\_perfect\_tense\_second\_person\_singular\_number
185
+ * LatinVerb.active\_voice\_subjunctive\_mood\_perfect\_tense\_third\_person\_singular\_number
186
+ * LatinVerb.active\_voice\_subjunctive\_mood\_perfect\_tense\_first\_person\_plural\_number
187
+ * LatinVerb.active\_voice\_subjunctive\_mood\_perfect\_tense\_second\_person\_plural\_number
188
+ * LatinVerb.active\_voice\_subjunctive\_mood\_perfect\_tense\_third\_person\_plural\_number
189
+
190
+ * LatinVerb.active\_voice\_subjunctive\_mood\_pastperfect\_tense\_first\_person\_singular\_number
191
+ * LatinVerb.active\_voice\_subjunctive\_mood\_pastperfect\_tense\_second\_person\_singular\_number
192
+ * LatinVerb.active\_voice\_subjunctive\_mood\_pastperfect\_tense\_third\_person\_singular\_number
193
+ * LatinVerb.active\_voice\_subjunctive\_mood\_pastperfect\_tense\_first\_person\_plural\_number
194
+ * LatinVerb.active\_voice\_subjunctive\_mood\_pastperfect\_tense\_second\_person\_plural\_number
195
+ * LatinVerb.active\_voice\_subjunctive\_mood\_pastperfect\_tense\_third\_person\_plural\_number
196
+
197
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_present\_tense\_first\_person\_singular\_number
198
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_present\_tense\_second\_person\_singular\_number
199
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_present\_tense\_third\_person\_singular\_number
200
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_present\_tense\_first\_person\_plural\_number
201
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_present\_tense\_second\_person\_plural\_number
202
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_present\_tense\_third\_person\_plural\_number
203
+
204
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_imperfect\_tense\_first\_person\_singular\_number
205
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_imperfect\_tense\_second\_person\_singular\_number
206
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_imperfect\_tense\_third\_person\_singular\_number
207
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_imperfect\_tense\_first\_person\_plural\_number
208
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_imperfect\_tense\_second\_person\_plural\_number
209
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_imperfect\_tense\_third\_person\_plural\_number
210
+
211
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_perfect\_tense\_first\_person\_singular\_number
212
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_perfect\_tense\_second\_person\_singular\_number
213
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_perfect\_tense\_third\_person\_singular\_number
214
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_perfect\_tense\_first\_person\_plural\_number
215
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_perfect\_tense\_second\_person\_plural\_number
216
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_perfect\_tense\_third\_person\_plural\_number
217
+
218
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_pastperfect\_tense\_first\_person\_singular\_number
219
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_pastperfect\_tense\_second\_person\_singular\_number
220
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_pastperfect\_tense\_third\_person\_singular\_number
221
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_pastperfect\_tense\_first\_person\_plural\_number
222
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_pastperfect\_tense\_second\_person\_plural\_number
223
+ * LatinVerb.passive\_voice\_subjunctive\_mood\_pastperfect\_tense\_third\_person\_plural\_number
224
+
225
+ * LatinVerb.imperatives[0]
226
+ * LatinVerb.imperatives[1]
227
+
228
+ * LatinVerb.present\_active\_participle
229
+ * LatinVerb.future\_active\_participle
230
+ * LatinVerb.perfect\_passive\_participle
231
+ * LatinVerb.future\_passive\_participle
232
+
233
+ * LatinVerb.present\_active\_infinitive
234
+ * LatinVerb.perfect\_active\_infinitive
235
+ * LatinVerb.future\_active\_infinitive
236
+ * LatinVerb.present\_passive\_infinitive
237
+ * LatinVerb.perfect\_passive\_infinitive)
247
238
 
248
239
  ## AUTHOR
249
240
 
@@ -251,10 +242,8 @@ Steven G. Harms (http://stevengharms.com)
251
242
 
252
243
  ## THANKS
253
244
 
254
- Thanks to the Austin Ruby coders group who answered questions that helped me put
255
- this all together. Thanks also to the Reject^{2} conference at the Lone Star
256
- Ruby Conference 2008 who helped me think through some of the metaprogrammatic
257
- approaches. Thanks to Professor James Burleson of Austin Community College who
258
- insisted, old-style, of a mastery of the rote basics of Latin. Thanks also to
259
- Lauren Roth ( http://www.laurennroth.com) for her support and encouragement and
260
- understanding of my pre-dawn hack sessions.
245
+ Thanks to the Austin Ruby coders group who answered questions that helped me put this all together. Thanks also
246
+ to the Reject^{2} conference at the Lone Star Ruby Conference 2008 who helped me think through some of the
247
+ metaprogrammatic approaches. Thanks to Professor James Burleson of Austin Community College who insisted,
248
+ old-style, of a mastery of the rote basics of Latin. Thanks also to Lauren Roth ( http://www.laurennroth.com)
249
+ for her support and encouragement and understanding of my pre-dawn hack sessions.
data/bin/latinirb CHANGED
@@ -3,5 +3,5 @@
3
3
  # Add the gem libraries to the Ruby path
4
4
  $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
5
5
 
6
- require 'LatinIRB'
6
+ require 'latinirb'
7
7
  Linguistics::Latin::Util::LatinIRB.begin
data/latinirb.gemspec CHANGED
@@ -20,5 +20,10 @@ Gem::Specification.new do |s|
20
20
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
21
  s.require_paths = ["lib"]
22
22
 
23
- s.add_dependency("latinverb",">=0.9.3")
23
+ s.add_runtime_dependency 'latinverb', '= 0.9.0'
24
+ s.add_runtime_dependency 'macronconversions'
25
+ s.add_runtime_dependency 'verbvector'
26
+ s.add_runtime_dependency 'active_support', '>= 3.0'
27
+
28
+
24
29
  end
data/latinverb.rb ADDED
@@ -0,0 +1,544 @@
1
+ # encoding: utf-8
2
+
3
+ module Latin
4
+
5
+ =begin rdoc
6
+
7
+ == Description
8
+
9
+ LatinVerb is a class for turning a given 4-part string of:
10
+
11
+ * active voice, present, first person singular: amō, or amo
12
+ * present, active infinitive: amāre, or amare
13
+ * present, perfect, first person singular: amāvī, or amavi
14
+ * perfect passive participle: amatum, or amatus
15
+
16
+ Into a fully-exploded, fully conjugated Latin verb ( like you would see in
17
+ chart forms on Wikipedia et in locis alteriis.
18
+
19
+ These are traditionally given in Wheelock as:
20
+ <tt>amō, amāre, amāvī, amatum</tt>
21
+
22
+ Philosophically, in this class, we keep attributes and methods which are
23
+ used to define the meta-structure of the verb. The specific verb calls
24
+ ("Give me the present active participles" or "Give me the present tense
25
+ active indicative class") are handled metaprogrammatically and held
26
+ in Latin::LatinConjugation.
27
+
28
+ =end
29
+
30
+
31
+ class LatinVerb < Latin::LatinWord
32
+ include Latin::Conjugation
33
+ include Latin::Display
34
+ =begin
35
+
36
+ Scalar, created during initialization
37
+ These are iVar's pointing to the “four principal parts” of a Latin
38
+ verb.
39
+
40
+ =end
41
+
42
+ attr_reader :first_pers_singular, :pres_act_inf,
43
+ :first_pers_perf, :pass_perf_part, :conjugation
44
+
45
+ =begin
46
+
47
+ Conjugation state, set by metapgrogrammatically handling the method
48
+ call. Latin verbs have voice, mood, tense, number, and person. The
49
+ :voice, :mood, etc. iVars will trap this. The default mode
50
+ use case is to return all number / person “nodes” in a given
51
+ tense. As such, the number and person are not stored here as iVars.
52
+
53
+ =end
54
+
55
+ attr_reader :voice, :mood, :tense, :number, :person
56
+
57
+ =begin
58
+
59
+ Here are iVars that are used in calculation of nodes.
60
+
61
+ Stem is a place to store the verb stem e.g. amare=>ama, dicere => dic
62
+ Vector is the original method that's passed. As mentioned above, we
63
+ take a metaprogrammatic approach to handling method calls to the
64
+ object. @vector records the method call that is trapped by
65
+ method_missing?(id,*opts)
66
+
67
+ Participal stem is used as the base for forming participles.
68
+
69
+ Response is stored. It is a hash
70
+ with only one pair: the name of the collection accessed, and the block
71
+ of nodes ( or a single node, if it has been defined in such an
72
+ explicit fashion )
73
+
74
+ Collections is is where the displayable payload is stored.
75
+
76
+ =end
77
+
78
+ attr_reader :stem, :participial_stem, :vector, :response,
79
+ :collections
80
+
81
+ =begin
82
+
83
+ Array
84
+
85
+ Four_pp is an aray of the four principal parts ( headers on listings)
86
+
87
+ =end
88
+
89
+ attr_reader :four_pp
90
+
91
+ =begin
92
+
93
+ ##############################################################################
94
+ METHOD DECLARATION
95
+ ##############################################################################
96
+
97
+ =end
98
+
99
+ =begin rdoc
100
+
101
+ <b>Arguments</b>: Array containing 4 principal parts
102
+
103
+ <b>Attribs Used</b>: N/A
104
+
105
+ <b>Attribs Set</b>: @four_pp, @first_pers_singular, @pres_act_inf,
106
+ @first_pers_perf, @pass_perf_part, @four_pp,
107
+ @voice_mood_matrix, @stem ( via #calculate_stem)
108
+
109
+ *Returns*: Instance of LatinVerb
110
+
111
+ *Purpose*: A LatinVerb is created by passing an array of the four principal
112
+ parts that define a Latin Verb. Typically these are: They are defined in an array:
113
+ <tt>amō amāre amāvī amatum</tt>.
114
+
115
+ =end
116
+
117
+ def initialize(*params)
118
+
119
+ # Creates an array of LatinWords for each of the passed-in parameters
120
+ # Each principal part is given its own iVar
121
+
122
+ @four_pp = params[0].map { |a_principal_part| Latin::LatinWord.new(a_principal_part) }
123
+
124
+ if @four_pp.length != 4
125
+ deponent_handler if @four_pp[2] =~ /sum$/
126
+ end
127
+
128
+ irregular_handler(@four_pp[1])
129
+
130
+
131
+ @first_pers_singular, @pres_act_inf,
132
+ @first_pers_perf, @pass_perf_part = @four_pp
133
+
134
+ # Create a top-level matrix that defines active_indicative /
135
+ # passive_indicative, etc.
136
+ #
137
+ # ____________
138
+ # | | X | Y |
139
+ # | 1 | a | b |
140
+ # | 2 | c | d |
141
+ # -------------
142
+ #
143
+ # In this case we have “voice by mood”
144
+
145
+ @voice_mood_matrix = TenseBlock.new( {
146
+ :boundaries => 'voice by mood',
147
+ :voice => %w(Active Passive),
148
+ :mood => %w(Indicative Subjunctive),
149
+ :tense => nil,
150
+ :default_p => lambda {
151
+ |x,y| "#{x.downcase}_voice_#{y.downcase}_mood"
152
+ }
153
+ }
154
+ )
155
+
156
+ # Given the 4 PP's, we can now derive the stem
157
+ @stem = Latin::LatinWord.new(calculate_stem)
158
+
159
+ # Set my conjugation
160
+ @conjugation = evaluate_conjugation
161
+
162
+ # Calculate participal stem
163
+ @participial_stem = Latin::LatinWord.new(calculate_participial_stem)
164
+
165
+ # Where to store things to-be displayed
166
+ @collections = []
167
+
168
+
169
+ end
170
+
171
+ =begin rdoc
172
+
173
+ *Arguments*: Unrecognized method call, optional arguments
174
+
175
+ <b>Attribs Used</b>: N/A
176
+
177
+ <b>Attribs Set</b>: @vector
178
+
179
+ *Returns*: Instance of LatinVerb
180
+
181
+ *Purpose*: The method calls to a verb object can vary in over 100 ways, as such, coding that many methods seemed painful. Accordingly, we trap the unknown method call, parse it, and set iVars.
182
+
183
+ Having identified the iVars, we are able to call a hash structure
184
+ containing lambdas to do the appropriate processing based on the “vector”
185
+ of voice, mood, tense, person, etc.
186
+
187
+ =end
188
+ def method_missing(id, *args)
189
+ # We expect that method calls will be made to the object in the form:
190
+ # V.active_voice_indicative_mood_present_tense. Instead of having to
191
+ # create all these methods, we will look for unknown methods containing
192
+ # the pattern _voice_
193
+
194
+ if id.to_s =~ /_voice_/
195
+
196
+ @vector = id.to_s
197
+
198
+ # This assignation needs to be done each call to the metaprog.
199
+ # method because of the event that a verb was called for
200
+ # a tense vector, and then a node vector. The first instance's
201
+ # filling in of @number, @person will cause the second call to do
202
+ # the wrong thing
203
+
204
+ @number = @person = nil
205
+ evaluate_method(id)
206
+
207
+ # In the case that the instance has been used before to get
208
+ # a specific vector, then we want to clear it out
209
+ @collections=[] if not @person.nil? and not @collections.nil?
210
+
211
+ generated_method = [@voice,@mood,@tense].join('_').to_sym
212
+
213
+ raise("Method #{generated_method.to_} is not responded to!") unless
214
+ self.respond_to?(generated_method)
215
+
216
+ raise ("FLAMING DETH: pass to handler method returned nothing!") if
217
+ self.send(generated_method.to_sym).nil?
218
+
219
+
220
+ @collections <<
221
+ conjoin_nodes_with_labels(
222
+ self.send(generated_method),
223
+ TenseBlock.new( {
224
+ :boundaries => 'numbers by persons',
225
+ :numbers => %w(Singular Plural),
226
+ :persons => %w(First Second Third),
227
+ :tense => 'present',
228
+ }
229
+ )
230
+ )
231
+ else
232
+ super(id)
233
+ end
234
+ end
235
+
236
+ def to_s
237
+ display!("\n")
238
+ end
239
+
240
+ def definition_string
241
+ return @four_pp.join(', ').to_s
242
+ end
243
+ =begin
244
+
245
+ ##############################################################################
246
+ # PRIVATE METHODS BELOW
247
+ ##############################################################################
248
+
249
+ =end
250
+ private
251
+
252
+ =begin rdoc
253
+
254
+ *Arguments*: None
255
+
256
+ *Attribs Used*: @pres_act_inf
257
+
258
+ *Attribs Set*: None
259
+
260
+ *Returns*: The “stem” of a Latin Verb
261
+
262
+ *Purpose*: Based on the present active infinitive, identify the “stem” and set the @stem iVar.
263
+ The method also returns the stem value.
264
+
265
+ =end
266
+
267
+ def calculate_stem
268
+ # For efficiency, if the iVar @stem is defined, don't go through this structure
269
+
270
+ pres_act_inf = @pres_act_inf.to_s
271
+
272
+ if pres_act_inf =~ /āre$/
273
+ return pres_act_inf.gsub(/(.*)āre$/,'\\1ā')
274
+ end
275
+ if pres_act_inf =~ /ēre$/
276
+ return pres_act_inf.gsub(/(.*)ēre$/,'\\1ē')
277
+ end
278
+ if pres_act_inf =~ /ere$/
279
+ if @first_pers_singular =~ /io$/
280
+ return pres_act_inf.gsub(/(.*)ere$/,'\\1')
281
+ else
282
+ return pres_act_inf.gsub(/(.*)ere$/,'\\1')
283
+ end
284
+ end
285
+ if pres_act_inf =~ /īre$/
286
+ return pres_act_inf.gsub(/(.*)īre$/,'\\1')
287
+ end
288
+ end
289
+
290
+ =begin rdoc
291
+
292
+
293
+ *Arguments*: None
294
+
295
+ *Attribs Used*: @pres_act_inf
296
+
297
+ *Attribs Set*: @conjugation
298
+
299
+ *Returns*: The “stem” of a Latin Verb
300
+
301
+ *Purpose*: Based on the present, active infinitive, decide on the conjugation. This method requires that the endings be macron-ized in order to differentiate between _ere_ ( 2nd conjugation ) and _ere_ ( 4th conjugation). It returns the value as a String: <tt>1</tt>, <tt>2</tt>, <tt>3</tt>, <tt>4</tt>, or <tt>3IO</tt> (e.g. <i>duco/ducere</i>)
302
+
303
+ =end
304
+
305
+ def evaluate_conjugation
306
+ ending = @pres_act_inf.get_last_three_characters
307
+ returnValue = nil
308
+
309
+ if ending =~ /āre$/
310
+ returnValue = "1"
311
+ end
312
+
313
+ if ending =~ /ēre$/
314
+ returnValue = "2"
315
+ end
316
+
317
+ if ending =~ /ere$/
318
+ if @first_pers_singular.get_last_three_characters =~ /iō$/
319
+ returnValue = "3IO"
320
+ else
321
+ returnValue = "3"
322
+ end
323
+ end
324
+
325
+ if ending =~ /īre$/
326
+ returnValue = "4"
327
+ end
328
+
329
+ return returnValue
330
+ end
331
+
332
+ =begin rdoc
333
+
334
+ Calculate the participial stem, used in forming participles.
335
+
336
+ =end
337
+
338
+ def calculate_participial_stem
339
+ raise("@pres_act_inf was nil!") if
340
+ @pres_act_inf.nil? or @first_pers_singular.nil?
341
+
342
+ if @pres_act_inf.to_s =~ /(.*ā)re$/
343
+ return $1
344
+ end
345
+
346
+ if @pres_act_inf.to_s =~ /(.*ē)re$/
347
+ return $1
348
+ end
349
+
350
+ if @pres_act_inf.to_s =~ /(.*)ere$/
351
+ match=$1
352
+ if @first_pers_singular =~ /iō/
353
+ return match + "iē"
354
+ else
355
+ return match + "e"
356
+ end
357
+ end
358
+
359
+ if @pres_act_inf.to_s =~ /(.*)īre$/
360
+ return $1 + "iē"
361
+ end
362
+ end
363
+
364
+
365
+ =begin
366
+
367
+ This is used to print out a full vector's nodes. The value
368
+ of @vector is used as a title. The nodes that were produced
369
+ by means of the lambda are then printed out.
370
+
371
+ =end
372
+
373
+ def conjoin_nodes_with_labels(nodes,labels)
374
+ raise "conjoin_nodes failed to receieve a node or label set" if
375
+ nodes.nil? or labels.nil?
376
+ paired_node_array=[]
377
+
378
+ 0.upto(labels.length-1) do |i|
379
+ paired_node_array.push(Latin::LatinNode.new(labels.matrix[i],
380
+ nodes[i], {:displayable => 'valuesonly'}) )
381
+ end
382
+
383
+ tense_label = @vector.capitalize!.split(/_/).join(' ')
384
+
385
+ full_tense = Latin::LatinTense.new(tense_label, paired_node_array)
386
+
387
+ if @person.nil? and @number.nil? # For handling ...present_tense
388
+ return full_tense
389
+ elsif @number.nil? and not @person.nil? # number not defined; person yes
390
+
391
+ # Find the methods that match the parameter that we were given
392
+ matching_methods =
393
+ full_tense.verb_methods.map {|x| x if x =~ /#{@person}/}.compact!
394
+
395
+ # Call those methods and store the result to an array
396
+ ambiguous_results =
397
+ matching_methods.map{|aMethod| full_tense.send(aMethod.to_sym)}
398
+
399
+ # Return it
400
+ return ambiguous_results.join(", ")
401
+ elsif not @number.nil? and @person.nil?
402
+ # This guy is really just the inverse of the above.
403
+
404
+ # Find the methods that match the parameter that we were given
405
+ matching_methods =
406
+ full_tense.verb_methods.map {|x| x if x =~ /#{@number}/}.compact!
407
+
408
+ # Call those methods and store the result to an array
409
+ ambiguous_results =
410
+ matching_methods.map{|aMethod| full_tense.send(aMethod.to_sym)}
411
+
412
+ # Return it
413
+ return ambiguous_results.join(", ")
414
+
415
+ elsif not @number.nil? and not @person.nil? # fully specified node
416
+ locate_string = [@number,'number',@person,'person',].join('_')
417
+ return full_tense.send(locate_string.to_sym)
418
+ end
419
+
420
+ end
421
+
422
+ # This method is used internally to evaluate a method call that looks like
423
+ # a request for a conjugation. The first descriptor pair is chopped off
424
+ # from the given 'name' and the rest is held. The given is sent through
425
+ # is recognized? where, if valid, an iVar is set.
426
+ #
427
+ # e.g. active_voice performs @voice=active
428
+ #
429
+ # Failure to successfully classify raises an exception
430
+ #
431
+ # If there is anything left in 'rest', then the function is recursively
432
+ # called with 'rest'.
433
+ #
434
+
435
+ def evaluate_method(name)
436
+ command = name.to_s.match(/(\w+?_){2}/).to_s
437
+ rest = name.to_s[command.to_s.length..name.to_s.length]
438
+
439
+ # If you're at the last term, command does not get loaded
440
+ # but rest stays the same.
441
+ if command !~ /\w/ and name == rest
442
+ command = rest
443
+ rest = nil
444
+ end
445
+
446
+ # We've reached the end
447
+ return if command !~ /\w/ and rest !~ /\w/
448
+
449
+ # Recurse
450
+ evaluate_method(rest) if is_recognized?(command)
451
+
452
+ end
453
+
454
+ # Given a string of the form "active_voice" ( or a "value/term" pair )
455
+ # test its validity by Object.send(term.to_sym, value).
456
+
457
+ def is_recognized?(datum)
458
+ value, term = datum.split(/_/)
459
+ term = "calculate_" + term
460
+ send(term.to_sym, value)
461
+
462
+ # Return true, because the 'send' call did not throw an exception
463
+ return true
464
+ end
465
+
466
+ # Used to set the voice iVar OR raise an exception
467
+ def calculate_voice(param)
468
+ if param =~ /^(active|passive)$/i
469
+ @voice = param
470
+ return
471
+ end
472
+ raise "Unknown voice: #{param.to_s}, called."
473
+ end
474
+
475
+ # Used to set the voice iVar OR raise an exception
476
+ def calculate_mood(param)
477
+ param.gsub!(/\W/, '')
478
+ if param =~ /(indicative|subjunctive)/i
479
+ @mood = param.downcase
480
+ return
481
+ end
482
+ raise "Unknown mood: #{param.to_s}, called"
483
+ end
484
+
485
+ # Used to set the voice iVar OR raise an exception
486
+ def calculate_tense(param)
487
+ param.downcase!
488
+ if @mood == "indicative"
489
+ # All the legitimate moods in the indicative
490
+ if param == "present" or
491
+ param == "imperfect" or
492
+ param == "future" or
493
+ param == "perfect" or
494
+ param == "pluperfect" or
495
+ param == "pastperfect" or
496
+ param == "futureperfect"
497
+ @tense = param
498
+ end
499
+ elsif @mood == "subjunctive"
500
+ # All the legitimate moods in the subjunctive
501
+ if param == "present" or
502
+ param == "imperfect" or
503
+ param == "perfect" or
504
+ param == "pluperfect" or
505
+ param == "pastperfect"
506
+ @tense = param
507
+ end
508
+ else
509
+ raise "Tense [#{param}] was found to be invalid."
510
+ end
511
+ end
512
+
513
+ def calculate_person(param)
514
+ @person = param.downcase
515
+ end
516
+
517
+ def calculate_number(param)
518
+ @number = param.downcase
519
+ end
520
+
521
+ def deponent_handler
522
+ raise "Sorry, we do not handle (semi-) deponent verbs at this time. It's on the TODO list, thought!"
523
+ end
524
+
525
+ def irregular_handler(test_infinitive)
526
+ if %w(esse nōlle).find{|irregular| test_infinitive.to_s == irregular}
527
+ raise "Sorry, we do not handle irregular verbs at this time. It's on the TODO list, thought!"
528
+ end
529
+ end
530
+ end # ends the class
531
+
532
+ =begin rdoc
533
+
534
+ == Dependencies
535
+
536
+ None
537
+
538
+ == Author
539
+
540
+ Steven G. Harms, http://www.stevengharms.com
541
+
542
+ =end
543
+ end
544
+
data/lib/LatinIRB.rb CHANGED
@@ -44,7 +44,7 @@ module Linguistics
44
44
  # This will be the script IRB sources on execution. You can
45
45
  # pre-define variables (@aFirst, etc.) and convenience methods here.
46
46
 
47
- @CONF[:SCRIPT]="lib/latirb.rb"
47
+ @CONF[:SCRIPT]=File.join(File.dirname(__FILE__), %w|latirb.rb|)
48
48
 
49
49
  # No, do not tell me what you read in
50
50
  @CONF[:ECHO]=false
@@ -6,7 +6,7 @@ module Linguistics
6
6
  module Latin
7
7
  module Util
8
8
  class LatinIRB
9
- @aFirst = Linguistics::Latin::Verb::LatinVerb.new %q(amō amāre amāvī amatum)
9
+ @aFirst = Linguistics::Latin::Verb::LatinVerb.new Text::Latex::Util::Macronconversions.convert('am\={o} am\={a}re am\={a}v\={\i} amatum', 'mc')
10
10
  @aSecond = Linguistics::Latin::Verb::LatinVerb.new %q(moneō monēre monvī monitum)
11
11
  @aThird = Linguistics::Latin::Verb::LatinVerb.new %q(agō agere ēgī actum)
12
12
  @aThirdIO = Linguistics::Latin::Verb::LatinVerb.new %q(capiō capere cēpī captum)
@@ -3,7 +3,7 @@ module Linguistics
3
3
  module Latin
4
4
  module Util
5
5
  class LatinIRB
6
- VERSION = "0.0.2" # :nodoc:
6
+ VERSION = "0.2.5" # :nodoc:
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,73 +1,108 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: latinirb
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.2
3
+ version: !ruby/object:Gem::Version
5
4
  prerelease:
5
+ version: 0.2.5
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Steven G. Harms
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-04 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
12
+
13
+ date: 2011-06-02 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
15
16
  name: latinverb
16
- requirement: !ruby/object:Gem::Requirement
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - "="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.9.0
24
+ type: :runtime
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
27
+ name: macronconversions
28
+ prerelease: false
29
+ requirement: &id002 !ruby/object:Gem::Requirement
17
30
  none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: 0.9.3
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: "0"
22
35
  type: :runtime
36
+ version_requirements: *id002
37
+ - !ruby/object:Gem::Dependency
38
+ name: verbvector
23
39
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
40
+ requirement: &id003 !ruby/object:Gem::Requirement
25
41
  none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: 0.9.3
30
- description: This gem takes initial data describing a LatinVerb and allows this is
31
- be instantiated into an IRB session. Here the verb can be queried or displayed.
32
- email:
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: "0"
46
+ type: :runtime
47
+ version_requirements: *id003
48
+ - !ruby/object:Gem::Dependency
49
+ name: active_support
50
+ prerelease: false
51
+ requirement: &id004 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: "3.0"
57
+ type: :runtime
58
+ version_requirements: *id004
59
+ description: This gem takes initial data describing a LatinVerb and allows this is be instantiated into an IRB session. Here the verb can be queried or displayed.
60
+ email:
33
61
  - steven.harms@gmail.com
34
- executables:
62
+ executables:
35
63
  - latinirb
36
64
  extensions: []
65
+
37
66
  extra_rdoc_files: []
38
- files:
67
+
68
+ files:
39
69
  - .gitignore
40
70
  - Gemfile
41
71
  - README.markdown
42
72
  - Rakefile
43
73
  - bin/latinirb
44
74
  - latinirb.gemspec
75
+ - latinverb.rb
45
76
  - lib/LatinIRB.rb
46
77
  - lib/latinirb/paradigmatic_verbs.rb
47
78
  - lib/latinirb/version.rb
48
79
  - lib/latirb.rb
49
80
  homepage: http://rubygems.org/gems/latinverb
50
81
  licenses: []
82
+
51
83
  post_install_message:
52
84
  rdoc_options: []
53
- require_paths:
85
+
86
+ require_paths:
54
87
  - lib
55
- required_ruby_version: !ruby/object:Gem::Requirement
88
+ required_ruby_version: !ruby/object:Gem::Requirement
56
89
  none: false
57
- requirements:
58
- - - ! '>='
59
- - !ruby/object:Gem::Version
60
- version: '0'
61
- required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: "0"
94
+ required_rubygems_version: !ruby/object:Gem::Requirement
62
95
  none: false
63
- requirements:
64
- - - ! '>='
65
- - !ruby/object:Gem::Version
66
- version: '0'
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: "0"
67
100
  requirements: []
101
+
68
102
  rubyforge_project: latinverb
69
- rubygems_version: 1.8.23
103
+ rubygems_version: 1.8.5
70
104
  signing_key:
71
105
  specification_version: 3
72
106
  summary: Gem designed to explore verbs created by LatinVerb
73
107
  test_files: []
108
+