-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmapping.rb
35 lines (28 loc) · 860 Bytes
/
mapping.rb
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
require 'active_record'
class Sense < ActiveRecord::Base
set_table_name "sense"
has_many :synsets
belongs_to :word, :primary_key => "wordid", :foreign_key => "wordid"
belongs_to :synset, :primary_key => "synset", :foreign_key => "synset"
end
class Word < ActiveRecord::Base
set_table_name "word"
has_many :senses, :primary_key => "wordid", :foreign_key => "wordid"
end
class Synset < ActiveRecord::Base
set_table_name "synset"
has_many :defs, :class_name => "SynsetDef", :primary_key => "synset", :foreign_key => "synset"
has_many :examples, :class_name => "SynsetEx", :primary_key => "synset", :foreign_key => "synset"
end
class SynsetDef < ActiveRecord::Base
set_table_name "synset_def"
def to_s
self.def
end
end
class SynsetEx < ActiveRecord::Base
set_table_name "synset_ex"
def to_s
self.def
end
end