-
Notifications
You must be signed in to change notification settings - Fork 2
/
common.lisp
108 lines (99 loc) · 3.41 KB
/
common.lisp
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
;; (C) 2013 IBM Corporation
;; Author: Alexandre Rademaker
(in-package :wordnet2rdf)
(defclass synset ()
((id :initarg :id
:initform nil
:accessor synset-id)
(lex-filenum :initarg :lex-filenum
:initform nil
:accessor synset-lnum)
(ss-type :initarg :ss-type
:accessor synset-type)
(words :initarg :words
:initform nil
:accessor synset-words)
(pointers :initarg :pointers
:initform nil
:accessor synset-pointers)
(gloss :initarg :gloss
:accessor synset-gloss)
(frames :initarg :frames
:initform nil
:accessor synset-frames)
(base :initarg :base
:initform nil
:accessor synset-base)
(notes :initarg :notes
:initform nil
:accessor synset-notes)))
(defparameter *type-table* `(("n" 1 !wn30:NounSynset)
("v" 2 !wn30:VerbSynset)
("a" 3 !wn30:AdjectiveSynset)
("s" 5 !wn30:AdjectiveSatelliteSynset)
("r" 4 !wn30:AdverbSynset)))
(defparameter *type-table-inv* (mapcar (lambda (x) (list (nth 1 x) (nth 0 x) (nth 2 x)))
*type-table*))
(defparameter *ptrs-table* `(("~" !wn30:hypernymOf) ;; inverse hyponym @
("@" !wn30:hyponymOf) ;; inverse hypernym ~
("@i" !wn30:instanceOf)
("~i" !wn30:hasInstance)
("%m" !wn30:memberMeronymOf)
("#m" !wn30:memberHolonymOf)
("&" !wn30:similarTo)
("*" !wn30:entails)
("%s" !wn30:substanceMeronymOf)
("#s" !wn30:substanceHolonymOf)
("%p" !wn30:partMeronymOf)
("#p" !wn30:partHolonymOf)
(";c" !wn30:classifiedByTopic)
(";r" !wn30:classifiedByRegion)
(";u" !wn30:classifiedByUsage)
("-c" !wn30:classifiesByTopic)
("-r" !wn30:classifiesByRegion)
("-u" !wn30:classifiesByUsage)
("+" !wn30:derivationallyRelated)
(">" !wn30:causes)
("$" !wn30:sameVerbGroupAs)
("=" ((("na" "ns" "an" "sn") !wn30:attribute)))
("!" !wn30:antonymOf)
("^" !wn30:seeAlso)
("<" !wn30:participleOf)
("\\" ((("an" "aa" "as" "sn" "sa" "ss") !wn30:adjectivePertainsTo)
(("ra" "rs") !wn30:adverbPertainsTo)))))
;; remember that frames are ordered from 1-35
(defparameter *frames* '("Something ----s"
"Somebody ----s"
"It is ----ing"
"Something is ----ing PP"
"Something ----s something Adjective/Noun"
"Something ----s Adjective/Noun"
"Somebody ----s Adjective"
"Somebody ----s something"
"Somebody ----s somebody"
"Something ----s somebody"
"Something ----s something"
"Something ----s to somebody"
"Somebody ----s on something"
"Somebody ----s somebody something"
"Somebody ----s something to somebody"
"Somebody ----s something from somebody"
"Somebody ----s somebody with something"
"Somebody ----s somebody of something"
"Somebody ----s something on somebody"
"Somebody ----s somebody PP"
"Somebody ----s something PP"
"Somebody ----s PP"
"Somebody's (body part) ----s"
"Somebody ----s somebody to INFINITIVE"
"Somebody ----s somebody INFINITIVE"
"Somebody ----s that CLAUSE"
"Somebody ----s to somebody"
"Somebody ----s to INFINITIVE"
"Somebody ----s whether INFINITIVE"
"Somebody ----s somebody into V-ing something"
"Somebody ----s something with something"
"Somebody ----s INFINITIVE"
"Somebody ----s VERB-ing"
"It ----s that CLAUSE"
"Something ----s INFINITIVE"))