-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathwn_load.pl
More file actions
62 lines (47 loc) · 1.53 KB
/
wn_load.pl
File metadata and controls
62 lines (47 loc) · 1.53 KB
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
/* -----------------------------------------------------------------
wn_load.pl
Prolog program to load the WordNet databases.
SPDX-FileCopyrightText: 2017-26 Eric Kafe <kafe@megadoc.net>
SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0
Use load_wn/0 to load everything, ensure_pred/1 to load a single
relation, load_type/1, to load selected groups of relations,
f. ex. semantic (semrels) or lexical (lexrels).
----------------------------------------------------------------- */
:- include(db_version).
:- include(utils).
semrels('Semantic Relations', ['at','cs','ent','hyp','ins','mm','mp','ms','sim']).
lexrels('Lexical Relations', ['ant','der','per','ppl','sa','vgp']).
lexinfo('Lexical Info', ['cls','fr','s','sk','syntax']).
seminfo('Semantic Info', ['g']).
morphinfo('Morphological Info', ['exc']).
wndata([semrels,lexrels,lexinfo,seminfo,morphinfo]).
% --------------------------------------------------------------------------------
type_info(Type,Rels):-
call(Type,Label,Rels),
format('~n~w: ~w~n', [Label,Rels]).
allwn(Rels):-
wndata(Reltypes),
member(Type, Reltypes),
type_info(Type,Rels).
/* ------------------------------------------
Load WN
------------------------------------------ */
ensure_pred(P):-
atom_concat('prolog/wn_',P,F),
format('Loading ~w~n',[F]),
safe_consult(F).
% time_call(safe_consult(F)).
load_type(Type):-
type_info(Type,Rels),
member(P,Rels),
ensure_pred(P),
false.
load_type(_).
load_wn:-
allwn(L),
member(P,L),
ensure_pred(P),
false.
load_wn:-
nl.