summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2011-06-11 23:49:37 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2011-06-11 23:49:37 (GMT)
commit5e1fd46a66dec0db5bda84126e782fc6439d377e (patch) (side-by-side diff)
tree82a5ff8a3d239bf4d6c954c36fb556d711689f3b
parent169d0e2887a40e4d845efcaa1e46ec49d02421b7 (diff)
downloadellinika-5e1fd46a66dec0db5bda84126e782fc6439d377e.tar.gz
ellinika-5e1fd46a66dec0db5bda84126e782fc6439d377e.tar.bz2
Update conjugator.
* data/dbverb.struct (conjugation) <fold>: New member. Everything updated. (verb) <suffix_aor_path>: Rename to suffix. * data/irregular-verbs.xml: Update. * scm/conjugator.scm: Rewrite to accept different variants of conjugation.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--data/dbverb.struct221
-rw-r--r--data/irregular-verbs.xml9
-rw-r--r--scm/conjugator.scm255
-rw-r--r--scm/verbop.scm2
4 files changed, 282 insertions, 205 deletions
diff --git a/data/dbverb.struct b/data/dbverb.struct
index f4a4b33..d12704a 100644
--- a/data/dbverb.struct
+++ b/data/dbverb.struct
@@ -34,13 +34,14 @@ CREATE TABLE conjugation(
voice enum('act','pas'), -- Ενεργητηκή/Μεσοπαθητική
mood enum('ind','sub','imp'),
tense varchar(128),
- thema enum('pres','aor','sub','synt'), -- Ενεστώτα, Αόριστου, υποτακτικής, syntethic
+ thema char(32), -- enum('pres','aor','sub','synt'), -- Ενεστώτα, Αόριστου, υποτακτικής, syntethic
suffix char(32),
flect int(32), -- REL 8
accmap char(7), -- accent map
particle char(2), -- NULL/θα/να
aux varchar(128), -- REL 10
auxtense char(32),
+ fold varchar(16),
KEY (conj),
KEY (voice),
KEY (mood)
@@ -51,7 +52,7 @@ CREATE TABLE participle (
conj char(32), -- REL 9
voice enum('act','pas'), -- Ενεργητηκή/Μεσοπαθητική
tense char(32),
- thema enum('pres','aor','sub'), -- Ενεστώτα, Αόριστου, υποτακτικής
+ thema char(32), -- enum('pres','aor','sub'), -- Ενεστώτα, Αόριστου, υποτακτικής
suffix char(32),
flect char(32),
aux varchar(128)
@@ -95,144 +96,145 @@ INSERT INTO conjugation VALUES
-- Συζυγία Α'
-- Ενεργητηκή φωνή
-- Οριστική
-("A", "act", "ind", "Ενεστώτας", 'pres', NULL, 1, "000000", NULL, NULL, NULL),
-("A", "act", "ind", "Παρατατικός", 'pres', NULL, 2, "333333+", NULL, NULL, NULL),
-("A", "act", "ind", "Μέλλοντας διαρκείας", 'pres', NULL, 1, "000000", "θα", NULL, NULL),
-("A", "act", "ind", "Αόριστος", 'aor', NULL, 2, "333333+", NULL, NULL, NULL),
-("A", "act", "ind", "Παρακείμενος", 'synt', NULL, 0, NULL, NULL, "έχω", "Ενεστώτας"),
-("A", "act", "ind", "Υπερσυντέλικος", 'synt', NULL, 0, NULL, NULL, "έχω", "Παρατατικός"),
-("A", "act", "ind", "Συντελεσμένος μέλλοντας", 'synt', NULL, 0, NULL, "θα", "έχω", "Ενεστώτας"),
-("A", "act", "ind", "Μέλλοντας στιγμιαίος", 'sub', NULL, 1, "000000", "θα", NULL, NULL),
+("A", "act", "ind", "Ενεστώτας", 'pres', NULL, 1, "000000", NULL, NULL, NULL, NULL),
+("A", "act", "ind", "Παρατατικός", 'pres', NULL, 2, "333333+", NULL, NULL, NULL, NULL),
+("A", "act", "ind", "Μέλλοντας διαρκείας", 'pres', NULL, 1, "000000", "θα", NULL, NULL, NULL),
+("A", "act", "ind", "Αόριστος", 'aor', NULL, 2, "333333+", NULL, NULL, NULL, NULL),
+("A", "act", "ind", "Παρακείμενος", 'synt', NULL, 0, NULL, NULL, "έχω", "Ενεστώτας", NULL),
+("A", "act", "ind", "Υπερσυντέλικος", 'synt', NULL, 0, NULL, NULL, "έχω", "Παρατατικός", NULL),
+("A", "act", "ind", "Συντελεσμένος μέλλοντας", 'synt', NULL, 0, NULL, "θα", "έχω", "Ενεστώτας", NULL),
+("A", "act", "ind", "Μέλλοντας στιγμιαίος", 'sub', NULL, 1, "000000", "θα", NULL, NULL, NULL),
-- Υποτακτική
-("A", "act", "sub", "Ενεστώτας", 'pres', NULL, 1, "000000", "να", NULL, NULL),
-("A", "act", "sub", "Αόριστος", 'sub', NULL, 1, "000000", "να", NULL, NULL),
-("A", "act", "sub", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Ενεστώτας"),
+("A", "act", "sub", "Ενεστώτας", 'pres', NULL, 1, "000000", "να", NULL, NULL, NULL),
+("A", "act", "sub", "Αόριστος", 'sub', NULL, 1, "000000", "να", NULL, NULL, NULL),
+("A", "act", "sub", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Ενεστώτας", NULL),
-- Προστακτική
-("A", "act", "imp", "Ενεστώτας", 'pres', NULL, 8, "-3--3-", NULL, NULL, NULL),
-("A", "act", "imp", "Αόριστος", 'sub', NULL, 9, "-3--0-", NULL, NULL, NULL),
-("A", "act", "imp", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Ενεστώτας"),
+("A", "act", "imp", "Ενεστώτας", 'pres', NULL, 8, "-3--3-", NULL, NULL, NULL, NULL),
+("A", "act", "imp", "Αόριστος", 'sub', NULL, 9, "-3--0-", NULL, NULL, NULL, NULL),
+("A", "act", "imp", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Ενεστώτας", NULL),
-- Μεσοπαθητική φωνή
-- Οριστική
-("A", "pas", "ind", "Ενεστώτας", 'pres', NULL, 11, "000300", NULL, NULL, NULL),
-("A", "pas", "ind", "Παρατατικός", 'pres', NULL, 12, "222333", NULL, NULL, NULL),
-("A", "pas", "ind", "Μέλλοντας διαρκείας", 'pres', NULL, 11, "333333", "θα", NULL, NULL),
-("A", "pas", "ind", "Αόριστος", 'aor', "ηκ", 2, "333333", NULL, NULL, NULL),
-("A", "pas", "ind", "Παρακείμενος", 'synt', NULL, 0, NULL, NULL, "έχω", "Ενεστώτας"),
-("A", "pas", "ind", "Υπερσυντέλικος", 'synt', NULL, 0, NULL, NULL, "έχω", "Παρατατικός"),
-("A", "pas", "ind", "Συντελεσμένος μέλλοντας", 'synt', NULL, 0, NULL, "θα", "έχω", "Ενεστώτας"),
-("A", "pas", "ind", "Μέλλοντας στιγμιαίος", 'aor', NULL, 15, "ffffff", "θα", NULL, NULL),
+("A", "pas", "ind", "Ενεστώτας", 'pres', NULL, 11, "000300", NULL, NULL, NULL, NULL),
+("A", "pas", "ind", "Παρατατικός", 'pres', NULL, 12, "222333", NULL, NULL, NULL, NULL),
+("A", "pas", "ind", "Μέλλοντας διαρκείας", 'pres', NULL, 11, "333333", "θα", NULL, NULL, NULL),
+("A", "pas", "ind", "Αόριστος", 'aor', "ηκ", 2, "333333", NULL, NULL, NULL, NULL),
+("A", "pas", "ind", "Παρακείμενος", 'synt', NULL, 0, NULL, NULL, "έχω", "Ενεστώτας", NULL),
+("A", "pas", "ind", "Υπερσυντέλικος", 'synt', NULL, 0, NULL, NULL, "έχω", "Παρατατικός", NULL),
+("A", "pas", "ind", "Συντελεσμένος μέλλοντας", 'synt', NULL, 0, NULL, "θα", "έχω", "Ενεστώτας", NULL),
+("A", "pas", "ind", "Μέλλοντας στιγμιαίος", 'aor', NULL, 15, "ffffff", "θα", NULL, NULL, NULL),
-- Υποτακτική
-("A", "pas", "sub", "Ενεστώτας", 'pres', NULL, 11, "333333", "να", NULL, NULL),
-("A", "pas", "sub", "Αόριστος", 'sub', NULL, 15, "ffffff", "να", NULL, NULL),
-("A", "pas", "sub", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Ενεστώτας"),
+("A", "pas", "sub", "Ενεστώτας", 'pres', NULL, 11, "333333", "να", NULL, NULL, NULL),
+("A", "pas", "sub", "Αόριστος", 'sub', NULL, 15, "ffffff", "να", NULL, NULL, NULL),
+("A", "pas", "sub", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Ενεστώτας", NULL),
-- Προστακτική
-("A", "pas", "imp", "Ενεστώτας", 'pres', NULL, 11, "-3--3-", "να", NULL, NULL),
-("A", "pas", "imp", "Αόριστος", 'aor', NULL, 17, "-0----", NULL, NULL, NULL),
-("A", "pas", "imp", "Αόριστος", 'aor', NULL, 18, "----2-", NULL, NULL, NULL),
-("A", "pas", "imp", "Παρακείμενος", 'synt', NULL, 0, "-0--0-", "να", "έχω", "Παρατατικός"),
+("A", "pas", "imp", "Ενεστώτας", 'pres', NULL, 11, "-3--3-", "να", NULL, NULL, NULL),
+("A", "pas", "imp", "Αόριστος", 'aor:act', NULL, 17, "-0----", NULL, NULL, NULL, "imp-aor"),
+("A", "pas", "imp", "Αόριστος", 'aor', NULL, 18, "----2-", NULL, NULL, NULL, "imp-aor"),
+("A", "pas", "imp", "Παρακείμενος", 'synt', NULL, 0, "-0--0-", "να", "έχω", "Ενεστώτας", NULL),
-- Συζυγία Β΄ - α΄ τάξη
-- Ενεργητηκή φωνή
-- Οριστική
-("B1", "act", "ind", "Ενεστώτας", 'pres', NULL, 20, "ffffff", NULL, NULL, NULL),
-("B1", "act", "ind", "Παρατατικός", 'pres', "ούς", 2, "ssssss", NULL, NULL, NULL),
-("B1", "act", "ind", "Μέλλοντας διαρκείας", 'pres', NULL, 20, "ffffff", "θα", NULL, NULL),
-("B1", "act", "ind", "Αόριστος", 'aor', "ησ", 2, "333333", NULL, NULL, NULL),
-("B1", "act", "ind", "Παρακείμενος", 'synt', NULL, 0, NULL, NULL, "έχω", "Ενεστώτας"),
-("B1", "act", "ind", "Υπερσυντέλικος", 'synt', NULL, 0, NULL, NULL, "έχω", "Παρατατικός"),
-("B1", "act", "ind", "Συντελεσμένος μέλλοντας", 'synt', NULL, 0, NULL, "θα", "έχω", "Ενεστώτας"),
-("B1", "act", "ind", "Μέλλοντας στιγμιαίος", 'aor', "ήσ", 1, "ssssss", "θα", NULL, NULL),
+("B1", "act", "ind", "Ενεστώτας", 'pres', NULL, 20, "ffffff", NULL, NULL, NULL, NULL),
+("B1", "act", "ind", "Παρατατικός", 'pres', "ούσ", 2, "ssssss", NULL, NULL, NULL, NULL),
+("B1", "act", "ind", "Παρατατικός", 'pres', "αγ", 2, "333333", NULL, NULL, NULL, NULL),
+("B1", "act", "ind", "Μέλλοντας διαρκείας", 'pres', NULL, 20, "ffffff", "θα", NULL, NULL, NULL),
+("B1", "act", "ind", "Αόριστος", 'aor', "ησ", 2, "333333", NULL, NULL, NULL, NULL),
+("B1", "act", "ind", "Παρακείμενος", 'synt', NULL, 0, NULL, NULL, "έχω", "Ενεστώτας", NULL),
+("B1", "act", "ind", "Υπερσυντέλικος", 'synt', NULL, 0, NULL, NULL, "έχω", "Παρατατικός", NULL),
+("B1", "act", "ind", "Συντελεσμένος μέλλοντας", 'synt', NULL, 0, NULL, "θα", "έχω", "Ενεστώτας", NULL),
+("B1", "act", "ind", "Μέλλοντας στιγμιαίος", 'aor', "ήσ", 1, "ssssss", "θα", NULL, NULL, NULL),
-- Υποτακτική
-("B1", "act", "sub", "Ενεστώτας", 'pres', NULL, 20, "ffffff", "να", NULL, NULL),
-("B1", "act", "sub", "Αόριστος", 'aor', "ήσ", 1, "ssssss", "να", NULL, NULL),
-("B1", "act", "sub", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Ενεστώτας"),
+("B1", "act", "sub", "Ενεστώτας", 'pres', NULL, 20, "ffffff", "να", NULL, NULL, NULL),
+("B1", "act", "sub", "Αόριστος", 'aor', "ήσ", 1, "ssssss", "να", NULL, NULL, NULL),
+("B1", "act", "sub", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Ενεστώτας", NULL),
-- Προστακτική
-("B1", "act", "imp", "Ενεστώτας", 'pres', NULL, 25, "-0--2-", NULL, NULL, NULL),
-("B1", "act", "imp", "Αόριστος", 'aor', "ησ", 9, "-3--3-", NULL, NULL, NULL),
-("B1", "act", "imp", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Ενεστώτας"),
+("B1", "act", "imp", "Ενεστώτας", 'pres', NULL, 25, "-0--2-", NULL, NULL, NULL, NULL),
+("B1", "act", "imp", "Αόριστος", 'aor', "ησ", 9, "-3--3-", NULL, NULL, NULL, NULL),
+("B1", "act", "imp", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Ενεστώτας", NULL),
-- Μεσοπαθητική φωνή
-- Οριστική
-("B1", "pas", "ind", "Ενεστώτας", 'pres', NULL, 28, "ffffff", NULL, NULL, NULL),
-("B1", "pas", "ind", "Παρατατικός", 'pres', NULL, 29, "ffffff", NULL, NULL, NULL),
-("B1", "pas", "ind", "Μέλλοντας διαρκείας", 'pres', NULL, 28, "ffffff", "θα", NULL, NULL),
-("B1", "pas", "ind", "Αόριστος", 'aor', "ηκ", 2, "333333", NULL, NULL, NULL),
-("B1", "pas", "ind", "Παρακείμενος", 'synt', NULL, 0, NULL, NULL, "έχω", "Ενεστώτας"),
-("B1", "pas", "ind", "Υπερσυντέλικος", 'synt', NULL, 0, NULL, NULL, "έχω", "Παρατατικός"),
-("B1", "pas", "ind", "Συντελεσμένος μέλλοντας", 'synt', NULL, 0, NULL, "θα", "έχω", "Ενεστώτας"),
-("B1", "pas", "ind", "Μέλλοντας στιγμιαίος", 'aor', NULL, 15, "ffffff", "θα", NULL, NULL),
+("B1", "pas", "ind", "Ενεστώτας", 'pres', NULL, 28, "ffffff", NULL, NULL, NULL, NULL),
+("B1", "pas", "ind", "Παρατατικός", 'pres', NULL, 29, "ffffff", NULL, NULL, NULL, NULL),
+("B1", "pas", "ind", "Μέλλοντας διαρκείας", 'pres', NULL, 28, "ffffff", "θα", NULL, NULL, NULL),
+("B1", "pas", "ind", "Αόριστος", 'aor', "ηκ", 2, "333333", NULL, NULL, NULL, NULL),
+("B1", "pas", "ind", "Παρακείμενος", 'synt', NULL, 0, NULL, NULL, "έχω", "Ενεστώτας", NULL),
+("B1", "pas", "ind", "Υπερσυντέλικος", 'synt', NULL, 0, NULL, NULL, "έχω", "Παρατατικός", NULL),
+("B1", "pas", "ind", "Συντελεσμένος μέλλοντας", 'synt', NULL, 0, NULL, "θα", "έχω", "Ενεστώτας", NULL),
+("B1", "pas", "ind", "Μέλλοντας στιγμιαίος", 'aor', NULL, 15, "ffffff", "θα", NULL, NULL, NULL),
-- Υποτακτική
-("B1", "pas", "sub", "Ενεστώτας", 'pres', NULL, 28, "ffffff", "να", NULL, NULL),
-("B1", "pas", "sub", "Αόριστος", 'aor', NULL, 15, "ffffff", "να", NULL, NULL),
-("B1", "pas", "sub", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Παρατατικός"),
+("B1", "pas", "sub", "Ενεστώτας", 'pres', NULL, 28, "ffffff", "να", NULL, NULL, NULL),
+("B1", "pas", "sub", "Αόριστος", 'aor', NULL, 15, "ffffff", "να", NULL, NULL, NULL),
+("B1", "pas", "sub", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Παρατατικός", NULL),
-- Προστακτική
-("B1", "pas", "imp", "Ενεστώτας", 'pres', NULL, 30, "-f--f-", "να", NULL, NULL),
+("B1", "pas", "imp", "Ενεστώτας", 'pres', NULL, 30, "-f--f-", "να", NULL, NULL, NULL),
-("B1", "pas", "imp", "Αόριστος", 'aor', NULL, 31, "-2----", NULL, NULL, NULL),
-("B1", "pas", "imp", "Αόριστος", 'aor', NULL, 32, "----2-", NULL, NULL, NULL),
+("B1", "pas", "imp", "Αόριστος", 'aor', NULL, 31, "-2----", NULL, NULL, NULL, NULL),
+("B1", "pas", "imp", "Αόριστος", 'aor', NULL, 32, "----2-", NULL, NULL, NULL, NULL),
-("B1", "pas", "imp", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Παρατατικός"),
+("B1", "pas", "imp", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Ενεστώτας", NULL),
-- Συζυγία Β΄ - β΄ τάξη
-- Ενεργητηκή φωνή
-- Οριστική
-("B2", "act", "ind", "Ενεστώτας", 'pres', NULL, 15, "ffffff", NULL, NULL, NULL),
-("B2", "act", "ind", "Παρατατικός", 'pres', "ούσ", 2, "ssssss", NULL, NULL, NULL),
-("B2", "act", "ind", "Μέλλοντας διαρκείας", 'pres', NULL, 15, "ffffff", "θα", NULL, NULL),
-("B2", "act", "ind", "Αόριστος", 'aor', "ησ", 2, "333333", NULL, NULL, NULL),
-("B2", "act", "ind", "Παρακείμενος", 'synt', NULL, 0, NULL, NULL, "έχω", "Ενεστώτας"),
-("B2", "act", "ind", "Υπερσυντέλικος", 'synt', NULL, 0, NULL, NULL, "έχω", "Παρατατικός"),
-("B2", "act", "ind", "Συντελεσμένος μέλλοντας", 'synt', NULL, 0, NULL, "θα", "έχω", "Ενεστώτας"),
-("B2", "act", "ind", "Μέλλοντας στιγμιαίος", 'aor', "ήσ", 1, "ssssss", "θα", NULL, NULL),
+("B2", "act", "ind", "Ενεστώτας", 'pres', NULL, 15, "ffffff", NULL, NULL, NULL, NULL),
+("B2", "act", "ind", "Παρατατικός", 'pres', "ούσ", 2, "ssssss", NULL, NULL, NULL, NULL),
+("B2", "act", "ind", "Μέλλοντας διαρκείας", 'pres', NULL, 15, "ffffff", "θα", NULL, NULL, NULL),
+("B2", "act", "ind", "Αόριστος", 'aor', "ησ", 2, "333333", NULL, NULL, NULL, NULL),
+("B2", "act", "ind", "Παρακείμενος", 'synt', NULL, 0, NULL, NULL, "έχω", "Ενεστώτας", NULL),
+("B2", "act", "ind", "Υπερσυντέλικος", 'synt', NULL, 0, NULL, NULL, "έχω", "Παρατατικός", NULL),
+("B2", "act", "ind", "Συντελεσμένος μέλλοντας", 'synt', NULL, 0, NULL, "θα", "έχω", "Ενεστώτας", NULL),
+("B2", "act", "ind", "Μέλλοντας στιγμιαίος", 'aor', "ήσ", 1, "ssssss", "θα", NULL, NULL, NULL),
-- Υποτακτική
-("B2", "act", "sub", "Ενεστώτας", 'pres', NULL, 15, "ffffff", "να", NULL, NULL),
-("B2", "act", "sub", "Αόριστος", 'aor', "ήσ", 1, "ssssss", "να", NULL, NULL),
-("B2", "act", "sub", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Ενεστώτας"),
+("B2", "act", "sub", "Ενεστώτας", 'pres', NULL, 15, "ffffff", "να", NULL, NULL, NULL),
+("B2", "act", "sub", "Αόριστος", 'aor', "ήσ", 1, "ssssss", "να", NULL, NULL, NULL),
+("B2", "act", "sub", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Ενεστώτας", NULL),
-- Προστακτική
-("B2", "act", "imp", "Ενεστώτας", 'pres', NULL, 15, "-f----", "να", NULL, NULL),
-("B2", "act", "imp", "Ενεστώτας", 'pres', NULL, 15, "----f-", NULL, NULL, NULL),
+("B2", "act", "imp", "Ενεστώτας", 'pres', NULL, 15, "-f----", "να", NULL, NULL, NULL),
+("B2", "act", "imp", "Ενεστώτας", 'pres', NULL, 15, "----f-", NULL, NULL, NULL, NULL),
-("B2", "act", "imp", "Αόριστος", 'aor', "ησ", 9, "-3--3-", NULL, NULL, NULL),
-("B2", "act", "imp", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Ενεστώτας"),
+("B2", "act", "imp", "Αόριστος", 'aor', "ησ", 9, "-3--3-", NULL, NULL, NULL, NULL),
+("B2", "act", "imp", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Ενεστώτας", NULL),
-- Μεσοπαθητική φωνή
-- Οριστική
-("B2", "pas", "ind", "Ενεστώτας", 'pres', NULL, 34, "ffffff", NULL, NULL, NULL),
-("B2", "pas", "ind", "Παρατατικός", 'pres', NULL, 35, "ffffff", NULL, NULL, NULL),
-("B2", "pas", "ind", "Μέλλοντας διαρκείας", 'pres', NULL, 34, "ffffff", "θα", NULL, NULL),
-("B2", "pas", "ind", "Αόριστος", 'aor', "ηκ", 2, "333333", NULL, NULL, NULL),
-("B2", "pas", "ind", "Παρακείμενος", 'synt', NULL, 0, NULL, NULL, "έχω", "Ενεστώτας"),
-("B2", "pas", "ind", "Υπερσυντέλικος", 'synt', NULL, 0, NULL, NULL, "έχω", "Παρατατικός"),
-("B2", "pas", "ind", "Συντελεσμένος μέλλοντας", 'synt', NULL, 0, NULL, "θα", "έχω", "Ενεστώτας"),
-("B2", "pas", "ind", "Μέλλοντας στιγμιαίος", 'aor', NULL, 15, "ffffff", "θα", NULL, NULL),
+("B2", "pas", "ind", "Ενεστώτας", 'pres', NULL, 34, "ffffff", NULL, NULL, NULL, NULL),
+("B2", "pas", "ind", "Παρατατικός", 'pres', NULL, 35, "ffffff", NULL, NULL, NULL, NULL),
+("B2", "pas", "ind", "Μέλλοντας διαρκείας", 'pres', NULL, 34, "ffffff", "θα", NULL, NULL, NULL),
+("B2", "pas", "ind", "Αόριστος", 'aor', "ηκ", 2, "333333", NULL, NULL, NULL, NULL),
+("B2", "pas", "ind", "Παρακείμενος", 'synt', NULL, 0, NULL, NULL, "έχω", "Ενεστώτας", NULL),
+("B2", "pas", "ind", "Υπερσυντέλικος", 'synt', NULL, 0, NULL, NULL, "έχω", "Παρατατικός", NULL),
+("B2", "pas", "ind", "Συντελεσμένος μέλλοντας", 'synt', NULL, 0, NULL, "θα", "έχω", "Ενεστώτας", NULL),
+("B2", "pas", "ind", "Μέλλοντας στιγμιαίος", 'aor', NULL, 15, "ffffff", "θα", NULL, NULL, NULL),
-- Υποτακτική
-("B2", "pas", "sub", "Ενεστώτας", 'pres', NULL, 34, "ffffff", "να", NULL, NULL),
-("B2", "pas", "sub", "Αόριστος", 'aor', NULL, 15, "ffffff", "να", NULL, NULL),
-("B2", "pas", "sub", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Παρατατικός"),
+("B2", "pas", "sub", "Ενεστώτας", 'pres', NULL, 34, "ffffff", "να", NULL, NULL, NULL),
+("B2", "pas", "sub", "Αόριστος", 'aor', NULL, 15, "ffffff", "να", NULL, NULL, NULL),
+("B2", "pas", "sub", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Παρατατικός", NULL),
-- Προστακτική
-("B2", "pas", "imp", "Ενεστώτας", 'pres', NULL, 36, "-f--f-", "να", NULL, NULL),
+("B2", "pas", "imp", "Ενεστώτας", 'pres', NULL, 36, "-f--f-", "να", NULL, NULL, NULL),
-("B2", "pas", "imp", "Αόριστος", 'aor', NULL, 31, "-2----", NULL, NULL, NULL),
-("B2", "pas", "imp", "Αόριστος", 'aor', NULL, 32, "----2-", NULL, NULL, NULL),
+("B2", "pas", "imp", "Αόριστος", 'aor', NULL, 31, "-2----", NULL, NULL, NULL, NULL),
+("B2", "pas", "imp", "Αόριστος", 'aor', NULL, 32, "----2-", NULL, NULL, NULL, NULL),
-("B2", "pas", "imp", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Παρατατικός"),
+("B2", "pas", "imp", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Ενεστώτας", NULL),
-- Αποθετικά ρήματα
-("A-depon", "act", "sub", "Αόριστος", 'sub', NULL, 1, "000000", "να", NULL, NULL),
+("A-depon", "act", "sub", "Αόριστος", 'sub', NULL, 1, "000000", "να", NULL, NULL, NULL),
-- Μεσοπαθητική φωνή
-- Οριστική
-("A-depon", "pas", "ind", "Ενεστώτας", 'pres', NULL, 11, "000300", NULL, NULL, NULL),
-("A-depon", "pas", "ind", "Παρατατικός", 'pres', NULL, 12, "222333", NULL, NULL, NULL),
-("A-depon", "pas", "ind", "Μέλλοντας διαρκείας", 'pres', NULL, 11, "333333", "θα", NULL, NULL),
-("A-depon", "pas", "ind", "Αόριστος", 'aor', NULL, 2, "000000", NULL, NULL, NULL),
-("A-depon", "pas", "ind", "Παρακείμενος", 'synt', NULL, 0, NULL, NULL, "έχω", "Ενεστώτας"),
-("A-depon", "pas", "ind", "Υπερσυντέλικος", 'synt', NULL, 0, NULL, NULL, "έχω", "Παρατατικός"),
-("A-depon", "pas", "ind", "Συντελεσμένος μέλλοντας", 'synt', NULL, 0, NULL, "θα", "έχω", "Ενεστώτας"),
-("A-depon", "pas", "ind", "Μέλλοντας στιγμιαίος", 'sub', NULL, 15, "000000", "θα", NULL, NULL),
+("A-depon", "pas", "ind", "Ενεστώτας", 'pres', NULL, 11, "000300", NULL, NULL, NULL, NULL),
+("A-depon", "pas", "ind", "Παρατατικός", 'pres', NULL, 12, "222333", NULL, NULL, NULL, NULL),
+("A-depon", "pas", "ind", "Μέλλοντας διαρκείας", 'pres', NULL, 11, "333333", "θα", NULL, NULL, NULL),
+("A-depon", "pas", "ind", "Αόριστος", 'aor', NULL, 2, "000000", NULL, NULL, NULL, NULL),
+("A-depon", "pas", "ind", "Παρακείμενος", 'synt', NULL, 0, NULL, NULL, "έχω", "Ενεστώτας", NULL),
+("A-depon", "pas", "ind", "Υπερσυντέλικος", 'synt', NULL, 0, NULL, NULL, "έχω", "Παρατατικός", NULL),
+("A-depon", "pas", "ind", "Συντελεσμένος μέλλοντας", 'synt', NULL, 0, NULL, "θα", "έχω", "Ενεστώτας", NULL),
+("A-depon", "pas", "ind", "Μέλλοντας στιγμιαίος", 'sub', NULL, 15, "000000", "θα", NULL, NULL, NULL),
-- Υποτακτική
-("A-depon", "pas", "sub", "Ενεστώτας", 'pres', NULL, 11, "333333", "να", NULL, NULL),
-("A-depon", "pas", "sub", "Αόριστος", 'sub', NULL, 1, "000000", "να", NULL, NULL),
-("A-depon", "pas", "sub", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Ενεστώτας"),
+("A-depon", "pas", "sub", "Ενεστώτας", 'pres', NULL, 11, "333333", "να", NULL, NULL, NULL),
+("A-depon", "pas", "sub", "Αόριστος", 'sub', NULL, 1, "000000", "να", NULL, NULL, NULL),
+("A-depon", "pas", "sub", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Ενεστώτας", NULL),
-- Προστακτική -- FIXME
-("A-depon", "pas", "imp", "Ενεστώτας", 'pres', NULL, 11, "-3--3-", "να", NULL, NULL),
-("A-depon", "pas", "imp", "Αόριστος", 'aor', NULL, 17, "-0----", NULL, NULL, NULL),
-("A-depon", "pas", "imp", "Αόριστος", 'aor', NULL, 18, "----2-", NULL, NULL, NULL),
-("A-depon", "pas", "imp", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Παρατατικός")
+("A-depon", "pas", "imp", "Ενεστώτας", 'pres', NULL, 11, "-3--3-", "να", NULL, NULL, NULL),
+("A-depon", "pas", "imp", "Αόριστος", 'aor', NULL, 17, "-0----", NULL, NULL, NULL, NULL),
+("A-depon", "pas", "imp", "Αόριστος", 'aor', NULL, 18, "----2-", NULL, NULL, NULL, NULL),
+("A-depon", "pas", "imp", "Παρακείμενος", 'synt', NULL, 0, "-0--0-", "να", "έχω", "Ενεστώτας", NULL)
;
INSERT INTO participle VALUES
@@ -261,8 +263,9 @@ CREATE TABLE verb(
conj char(32), -- REL 9
augment char(1),
accmap char(7),
- suffix_aor_path varchar(2),
- INDEX(verb)
+ suffix varchar(2),
+ INDEX(verb),
+ INDEX(conj)
);
DROP TABLE IF EXISTS individual_verb;
@@ -279,7 +282,7 @@ DROP TABLE IF EXISTS irregular_root;
CREATE TABLE irregular_root(
verb varchar(128),
voice enum('act','pas'), -- Ενεργητηκή/Μεσοπαθητική
- thema enum('pres','aor','sub'), -- Αόριστος/Υποτακτική
+ thema char(32), -- enum('pres','aor','sub'), -- Αόριστος/Υποτακτική
root varchar(128)
);
diff --git a/data/irregular-verbs.xml b/data/irregular-verbs.xml
index 697b2cd..8951bda 100644
--- a/data/irregular-verbs.xml
+++ b/data/irregular-verbs.xml
@@ -331,6 +331,15 @@
<pas>
<root theme="aor">ήρθ</root>
<root theme="sub">ερθ</root>
+ <imp>
+ <t name="Ενεστώτας">
+ <p n="p" p="2">έρχεστε</p>
+ </t>
+ <t name="Αόριστος">
+ <p n="s" p="2">έλα</p>
+ <p n="p" p="2">ελάτε</p>
+ </t>
+ </imp>
</pas>
</v>
diff --git a/scm/conjugator.scm b/scm/conjugator.scm
index 7783d3a..edc649e 100644
--- a/scm/conjugator.scm
+++ b/scm/conjugator.scm
@@ -1,4 +1,5 @@
-(use-modules (ellinika elmorph)
+(use-modules (srfi srfi-1)
+ (ellinika elmorph)
(ellinika i18n)
(ellinika cgi)
(ellinika tenses)
@@ -38,8 +39,10 @@
'())))
(define (my-sql-query conn query)
-; (display "Q:")(display query)(newline)
- (sql-query conn query))
+; (format #t "Q: ~A~%" query)
+ (let ((res (sql-query conn query)))
+; (format #t "R: ~A~%" res)
+ res))
(define (sql-error-handler key func fmt fmtargs data)
@@ -47,32 +50,37 @@
(_ "ΣΦΆΛΜΑ: σύνδεση με το λέξικο απέτυχε."))
(apply format (current-error-port) fmt fmtargs))
-(define (guess-verb-info verb)
- (let ((elverb (force-elstr verb)))
- (cond
- ;; FIXME
- ((elstr-suffix? elverb "άω")
- (list "B1"
+(define verb-info-template
+ (list
+ (list "A"
+ #f
+ "ε"
+ #f
+ #f
+ #f)
+ (list "B1"
#f
#f
- "ησ"
#f
- #f))
- ((elstr-suffix? elverb "ώ")
- (list "B2"
#f
+ #f)
+ (list "B2"
#f
- "ησ"
#f
- #f))
- ;; FIXME: deponentia?
- (else
- (list "A"
#f
- "ε"
#f
- #f
- #f)))))
+ #f)))
+
+(define (guess-verb-info verb)
+ (cond
+ ;; FIXME
+ ((elstr-suffix? verb "άω")
+ (assoc "B1" verb-info-template))
+ ((elstr-suffix? verb "ώ")
+ (assoc "B2" verb-info-template))
+ ;; FIXME: deponentia?
+ (else
+ (assoc "A" verb-info-template))))
(define (get-verb-info verb . rest)
(let ((conn (dict-connect))
@@ -82,7 +90,7 @@
(let ((vdb (my-sql-query
conn
(string-append
- "SELECT conj,accmap,augment,suffix_aor_path FROM verb \
+ "SELECT conj,accmap,augment,suffix FROM verb \
WHERE verb='" (force-string verb) "'"
class))))
(cond
@@ -98,9 +106,11 @@ WHERE verb='" (force-string verb) "'"
((elstr-suffix? verb "άω")
(get-verb-info (elstr-append
(elstr-trim verb -2) "ώ") "B1"))
+ ((null? rest)
+ (guess-verb-info verb))
(else
- (guess-verb-info verb))))))
-
+ (assoc (car rest) verb-info-template))))))
+
(define (thema-aoristoy-mesapathitikis root)
(cond
((elstr-suffix? root "αίν")
@@ -148,7 +158,7 @@ WHERE verb='" verb "' AND voice='" voice "' AND thema='" thema "'")))
(error "cannot handle ~A~%" verb))))
(define (complement-verb-info vinfo verb voice thema)
-; (format #t "COMPLEMENT ~S~%" thema)
+; (format #t "COMPLEMENT ~A~%" thema)
(let ((elverb (string->elstr verb))
(result (let ((tmpres (lookup-verb-info verb voice thema)))
(if (and (null? tmpres) (string=? thema "sub"))
@@ -254,20 +264,22 @@ WHERE verb='" verb "' AND voice='" voice "' AND thema='" thema "'")))
(list-ref v 4))
((conj-info #:auxtense v)
(list-ref v 5))
+ ((conj-info #:fold v)
+ (list-ref v 6))
((conj-info #:flect v)
- (list-tail v 6))
+ (list-tail v 7))
((conj-info #:sing 1 v)
- (list-ref v 7))
- ((conj-info #:sing 2 v)
(list-ref v 8))
- ((conj-info #:sing 3 v)
+ ((conj-info #:sing 2 v)
(list-ref v 9))
- ((conj-info #:plur 1 v)
+ ((conj-info #:sing 3 v)
(list-ref v 10))
((conj-info #:plur 1 v)
(list-ref v 11))
((conj-info #:plur 1 v)
- (list-ref v 12))))
+ (list-ref v 12))
+ ((conj-info #:plur 1 v)
+ (list-ref v 13))))
(define-syntax conj-info-set!
(syntax-rules ()
@@ -279,14 +291,14 @@ WHERE verb='" verb "' AND voice='" voice "' AND thema='" thema "'")))
(let ((answer (my-sql-query
conn
(string-append
- "SELECT c.thema,c.suffix,c.accmap,c.particle,c.aux,c.auxtense,\
+ "SELECT c.thema,c.suffix,c.accmap,c.particle,c.aux,c.auxtense,c.fold AS fold,\
f.sing1,f.sing2,f.sing3,f.plur1,f.plur2,f.plur3 \
FROM conjugation c, verbflect f \
WHERE c.conj='" conj "' AND c.voice='" voice "' AND c.mood='" mood
-"' AND c.tense='" tense "' AND c.flect = f.ident"))))
+"' AND c.tense='" tense "' AND c.flect = f.ident ORDER by fold"))))
(if (null? answer)
#f
- (car answer)))))
+ answer))))
(define (force-string str)
(if (elstr? str)
@@ -316,7 +328,7 @@ WHERE c.conj='" conj "' AND c.voice='" voice "' AND c.mood='" mood
(conj-info #:accmap conj)
"000000")))
(augment ""))
-; (format #t "ROOT ~S, ACCMAP ~S~%" root accmap)
+; (format #t "ROOT ~S, ACCMAP ~S, SUFFIX: ~S~%" root accmap suffix)
(cond
((> (length accmap) 6)
(set! accmap (list-head accmap 6))
@@ -394,51 +406,88 @@ WHERE i.verb='" verb "' AND i.voice='" voice "' AND i.mood='" mood
'(class root)))
#f)))
+(define (merge-conjugated-forms lista listb)
+ (map
+ (lambda (a b)
+ (or a b))
+ lista listb))
+
(define (conjugate verb voice mood tense . rest)
(cond
((individual-verb verb voice mood tense) =>
(lambda (res)
- res))
+ (list res)))
(else
- (let* ((vinfo (get-verb-info verb))
- (conj (get-conj-info (verb-info #:conj vinfo) voice mood tense)))
- (if (not conj)
- (error "cannot obtain conjugation information for "
- (verb-info #:conj vinfo) voice mood tense))
- (if (member #:nopart rest)
- (conj-info-set! #:particle conj #f))
- (cond
- ((string=? (conj-info #:thema conj) "synt")
- (let* ((verb-conj (conjugate verb voice "sub" "Αόριστος" #:nopart))
- (form (list-ref verb-conj 2))
- (part (conj-info #:particle conj)))
- (cond
- (form
-; (format #t "FORM ~A FROM ~A~%" form verb-conj);;FIXME
- (append
- (map
- (lambda (aux flag)
- (if (char=? flag #\-)
- #f
- (elstr->string
- (if part
- (elstr-append part " " aux " " form)
- (elstr-append aux " " form)))))
- (conjugation:table (conjugate (conj-info #:aux conj) "act" "ind"
- (conj-info #:auxtense conj)))
- (string->list (or (verb-info #:accmap vinfo)
- (conj-info #:accmap conj)
- "000000")))
- (list (verb-info #:conj vinfo)
- (conjugation:attested verb-conj))))
- (else
- #f))))
- (else
- ; (format #t "CONJ ~S~%" conj)
- (complement-verb-info vinfo verb voice (conj-info #:thema conj))
- (append (apply-flect conj vinfo verb)
- (list (verb-info #:conj vinfo)
- (verb-info #:attested vinfo)))))))))
+ (map car
+ (let* ((vinfo (get-verb-info verb))
+ (conj-list (get-conj-info (verb-info #:conj vinfo) voice mood
+ tense)))
+ (if (not conj-list)
+ (error "cannot obtain conjugation information for "
+ (verb-info #:conj vinfo) voice mood tense))
+ (fold-right
+ (lambda (elt prev)
+; (format #t "ELT ~A~%" elt)
+ (if (null? prev)
+ (list elt)
+ (let ((top (car prev)))
+ (if (let ((a (cdr elt))
+ (b (cdr top)))
+ (and (string? a) (string? b) (string=? a b)))
+ (cons (cons
+ (merge-conjugated-forms (car top) (car elt))
+ (cdr top))
+ (cdr prev))
+ (cons elt prev)))))
+ '()
+ (map
+ (lambda (conj)
+; (format #t "CONJ ~S~%" conj)
+ (if (member #:nopart rest)
+ (conj-info-set! #:particle conj #f))
+ (cons
+ (cond
+ ((string=? (conj-info #:thema conj) "synt")
+ (let* ((verb-conj
+ (car (conjugate verb voice "sub" "Αόριστος" #:nopart)))
+ (form (list-ref verb-conj 2))
+ (part (conj-info #:particle conj)))
+ (cond
+ (form
+; (format #t "FORM ~A FROM ~A~%" form verb-conj);;FIXME
+ (append
+ (map
+ (lambda (aux flag)
+ (if (char=? flag #\-)
+ #f
+ (elstr->string
+ (if part
+ (elstr-append part " " aux " " form)
+ (elstr-append aux " " form)))))
+ (conjugation:table
+ (car (conjugate (conj-info #:aux conj) "act" "ind"
+ (conj-info #:auxtense conj))))
+ (string->list (or (verb-info #:accmap vinfo)
+ (conj-info #:accmap conj)
+ "000000")))
+ (list (verb-info #:conj vinfo)
+ (conjugation:attested verb-conj))))
+ (else
+ #f))))
+ (else
+ (let ((thema (string-split (conj-info #:thema conj) #\:)))
+; (format #t "THEMA ~A~%" thema)
+ (complement-verb-info vinfo verb
+ (if (null? (cdr thema))
+ voice
+ (car (cdr thema)))
+ (car thema))
+; (format #t "VINFO ~A~%" vinfo)
+ (append (apply-flect conj vinfo verb)
+ (list (verb-info #:conj vinfo)
+ (verb-info #:attested vinfo))))))
+ (conj-info #:fold conj)))
+ conj-list)))))))
(define (conjugation:table conj)
(cond
@@ -446,12 +495,15 @@ WHERE i.verb='" verb "' AND i.voice='" voice "' AND i.mood='" mood
#f)
(else
(list-head conj 6))))
+
+
(define (conjugation:class conj)
(cond
((not conj)
#f)
(else
(list-ref conj 6))))
+
(define (conjugation:attested conj)
(cond
((not conj)
@@ -487,24 +539,26 @@ WHERE i.verb='" verb "' AND i.voice='" voice "' AND i.mood='" mood
(or (assoc-ref transtab x) x))
(define (test-conjugation verb voice mood tense)
- (format #t "~A ~A/~A/~A: " verb (term voice) (term mood) tense)
- (let* ((result (conjugate verb voice mood tense))
- (conj (conjugation:table result)))
- (cond
- ((empty-conjugation? conj)
- (display "#f"))
- (else
- (let ((att (conjugation:attested result)))
- (cond
- ((not att)
- (display "*"))
- (else
- (if (not (member 'class att))
- (display "*"))
- (if (not (member 'root att))
- (display "!"))))
- (display conj)))))
- (newline)
+ (for-each
+ (lambda (result)
+ (format #t "~A ~A/~A/~A: " verb (term voice) (term mood) tense)
+ (let ((conj (conjugation:table result)))
+ (cond
+ ((empty-conjugation? conj)
+ (display "#f"))
+ (else
+ (let ((att (conjugation:attested result)))
+ (cond
+ ((not att)
+ (display "*"))
+ (else
+ (if (not (member 'class att))
+ (display "*"))
+ (if (not (member 'root att))
+ (display "!"))))
+ (display conj)))))
+ (newline))
+ (conjugate verb voice mood tense))
(gc))
(define (test-voice voice verb)
@@ -526,7 +580,7 @@ WHERE i.verb='" verb "' AND i.voice='" voice "' AND i.mood='" mood
;; (test-conjugation "είμαι" "act" "ind" "Αόριστος")
;; (test-conjugation "έχω" "act" "ind" "Ενεστώτας")
-;; (test-conjugation "έχω" "act" "ind" "Παρατατίκος")
+(test-conjugation "έχω" "act" "ind" "Παρατατίκος")
;; (test-conjugation "έχω" "act" "ind" "Μέλλοντας διαρκείας")
;; (test-conjugation "έχω" "act" "sub" "Ενεστώτας")
;; (test-conjugation "έχω" "act" "imp" "Ενεστώτας")
@@ -588,5 +642,16 @@ WHERE i.verb='" verb "' AND i.voice='" voice "' AND i.mood='" mood
;; (test-conjugation "έρχομαι" "pas" "ind" "Ενεστώτας");FIXME!
;; (test-conjugation "έρχομαι" "pas" "ind" "Υπερσυντέλικος")
-(test-voice "pas" "ντύνω")
+;(test-voice "pas" "ντύνω")
+(test-voice "pas" "έρχομαι")
+
+;(display (conjugate "ντύνω" "pas" "ind" "Ενεστώτας"))
+;(newline)
+;(display (conjugate "ντύνω" "pas" "imp" "Αόριστος"))
+;(newline)
+;(display (conjugate "ντύνω" "pas" "ind" "Συντελεσμένος Μέλλοντας"))
+;(newline)
+;(display (conjugate "τραβάω" "act" "ind" "Παρατατικός"))
+;(newline)
+
(newline)
diff --git a/scm/verbop.scm b/scm/verbop.scm
index f3ecc33..621ea6c 100644
--- a/scm/verbop.scm
+++ b/scm/verbop.scm
@@ -267,7 +267,7 @@ VALUES (~A,~A,~A,~A);~%"
;;
(case (verb-get #:action)
((insert)
- (run-query "INSERT INTO verb (verb,conj,augment,accmap,suffix_aor_path) \
+ (run-query "INSERT INTO verb (verb,conj,augment,accmap,suffix) \
VALUES (~A,~A,~A,~A,~A);~%"
(verb-get-sql #:verb)
(verb-get-sql #:class)

Return to:

Send suggestions and report system problems to the System administrator.