summaryrefslogtreecommitdiffabout
path: root/data/db.struct
blob: 61e3d25cd47866bdc91ea897f5f5e90f868e0109 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
-- This file is part of Ellinika
-- Copyright (C) 2004, 2005, 2007, 2015 Sergey Poznyakoff
--
-- Ellinika is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- Ellinika is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
--

set names utf8;
CREATE DATABASE ellinika CHARACTER SET utf8 COLLATE utf8_bin;

use ellinika;

CREATE TABLE pos(
 id 	bigint not null,                       -- REL 0
 name   char(64) not null ,
 abbr   char(12) not null,
 abbr_lat  char(12) not null,
 canonical enum('Y','N') not null default 'Y',
 INDEX(id),
 INDEX(abbr)
);

INSERT INTO pos VALUES(0,  "άρθρο",        "άρθρ.",  "art", 'Y');

INSERT INTO pos VALUES(conv("100",16,10),  "ουσιαστικό",   "ουσ.",   "subst", 'Y');
INSERT INTO pos VALUES(conv("101",16,10),  "αρσενικό",      "ο",  "m", 'Y');
INSERT INTO pos VALUES(conv("102",16,10),  "θηλυκό",        "η",  "f", 'Y');
INSERT INTO pos VALUES(conv("104",16,10),  "ουδέτερο",      "το",  "n", 'Y');
INSERT INTO pos VALUES(conv("101",16,10)|2,  "αρσενικό και θηλυκό", "ο/η", "m/f", 'N');
INSERT INTO pos VALUES(conv("101",16,10)|2,  "αρσενικό και θηλυκό", "ο,η", "m,f", 'Y');
INSERT INTO pos VALUES(conv("101",16,10)|2|4,"αρσενικό,θηλυκό,ουδέτερο", "ο,η,το", "m,f,n", 'N');
INSERT INTO pos VALUES(conv("114",16,10),  "πληθυντικό ουδέτερο",      "τα",  "pl.n", 'Y');

INSERT INTO pos VALUES(conv("200",16,10),  "επίθετο",      "επίθ.",   "adj", 'Y');

INSERT INTO pos VALUES(conv("400",16,10),  "επίρρημα",     "επίρρ.",  "adv", 'Y');

INSERT INTO pos VALUES(conv("800",16,10),  "αριθμός",      "αριθ.",   "num", 'Y');

INSERT INTO pos VALUES(conv("1000",16,10),  "αντωνυμία",     "αντων.",  "pron", 'Y');    

INSERT INTO pos VALUES(conv("100000",16,10),  "ρήμα",          "ρήμα",  "v", 'Y');    
INSERT INTO pos VALUES(conv("110000",16,10),  "μεταβατικό",   "μετ.",   "vt", 'Y');  
INSERT INTO pos VALUES(conv("120000",16,10),  "αμετάβατο",    "αμετ.",  "vi", 'Y'); 
INSERT INTO pos VALUES(conv("140000",16,10),  "απρόσωπος",      "απρόσ.",  "vimp", 'Y'); 
INSERT INTO pos VALUES(conv("180000",16,10),  "αποθετικό",     "αποθ.",   "vdep", 'Y'); 

INSERT INTO pos VALUES(conv("200000",16,10),  "επιφώνημα",    "επιφ.",  "int", 'Y');

INSERT INTO pos VALUES(conv("400000",16,10),  "μετοχή",       "μετχ.",  "part", 'Y');

INSERT INTO pos VALUES(conv("800000",16,10),  "μόριο",        "μόριο.", "ptc", 'Y');

INSERT INTO pos VALUES(conv("1000000",16,10),  "πρόθεση",      "πρόθ.",  "prep", 'Y');

INSERT INTO pos VALUES(conv("2000000",16,10),  "σύνδεσμος",    "σύνδ.",  "conj", 'Y');

CREATE TABLE dict(
  ident         int(32),                    -- REL 1,3,4
  word          varchar(128),               -- REL 6
  sound         varchar(128),
  pos           int(4),                     -- REL 0
  forms         blob,
  INDEX (ident),
  INDEX  (word)
);

CREATE TABLE locus(
  ident         int(32),                    -- REL 4
  lang          varchar(8) not null, 
  file          varchar(128) binary,
  line          int(32),
  INDEX (ident),
  INDEX (lang)
);

CREATE TABLE articles(
  ident         int(32) not null,           -- REL 1
  subindex      int(32) not null,
  lang          varchar(8),                
  meaning       blob,
  INDEX (ident),
  INDEX (subindex),
  INDEX (lang)
);  

CREATE TABLE topic(
 ident         int(32) not null auto_increment, -- REL 2
 lang          varchar(8) not null,
 title         varchar(128) not null,         
 category      int(32) not null,                -- REL 5 
 UNIQUE  (ident),
 INDEX   (title),
 INDEX   (title,category),
 INDEX   (lang)
);

CREATE TABLE topic_tab (
 topic_ident    int(32) not null,               -- REL 2 
 word_ident     int(32) not null,               -- REL 1
 INDEX    (topic_ident),
 INDEX    (word_ident)
);

CREATE TABLE category (
 category      int(32) not null auto_increment, -- REL 5
 lang          varchar(8) not null,
 title         varchar(128) not null,
 description   blob,
 UNIQUE  (category),
 INDEX   (lang)
);

CREATE TABLE links(
 type enum('XREF','ANT') not null,
 ident    int(32) not null,                     -- REL 1
 xref     int(32) not null,                     -- REL 1
 INDEX    (ident),
 UNIQUE   (ident,xref)
);

CREATE TABLE stat(
 lang varchar(8) not null,
 updated datetime not null,
 count int(32) not null,
 UNIQUE(lang)
);

CREATE TABLE pending_links(
 type enum('CLOSED','XREF','ANT') not null,
 originator int(32) not null,                   -- REL 3
 word varchar(128)                              -- REL 6
);

CREATE TABLE news(
 ident int(32) not null auto_increment,         -- REL 7
 date datetime not null,
 UNIQUE(ident),
 INDEX(date)
);

CREATE TABLE newsart(
 ident int(32) not null,                        -- REL 7 
 lang  varchar(8),
 header varchar(255),
 text blob,
 UNIQUE(ident),
 INDEX(lang)
);

----

source ./dbverb.struct;
 

Return to:

Send suggestions and report system problems to the System administrator.