Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
201 changes: 0 additions & 201 deletions LICENSE

This file was deleted.

17 changes: 17 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
This software contains multiple components under different licenses:

1. PROLOG LIBRARY CODE
- License: Apache License 2.0
- SPDX: Apache-2.0
- Files: All files in root directory
- [Text](LICENSES/Apache-2.0.txt)
- [Online](https://www.apache.org/licenses/LICENSE-2.0)

2. WORDNET DOCUMENTATION and DATABASE FILES:
- License: WordNet License
- SPDX: WordNet
- Files: Files in doc/ and prolog/ directories
- [Text](LICENSES/WordNet.txt)
- [Online](https://opensource.org/license/wordnet)

Individual file headers contain SPDX-License-Identifier tags.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,10 @@ make valid PL=gprolog
### 2026

- Transitive relation closures in linear time
- Use no hard cut.
- Use call/N instead of univ (=..).
- Add loader.pl, to load files only once.
- Quote strings and fix quotes in CSV output.
- Use no hard cut
- Use call/N instead of univ (=..)
- Add loader.pl, to load files only once
- Quote strings and fix quotes in CSV output
- Add SPDX license and copyright tags
- Portable output predicates
- Portability validation workflow
- Release workflow
- Improve portability
- Check portability with Github Action
2 changes: 1 addition & 1 deletion loader.pl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
iniloader:-
current_predicate(safe_consult/1) -> true
; assertz((
safe_consult(File) :-
safe_consult(File) :- % Replaces ensure_loaded/1 (ISO)
( already_loaded(File)
-> format('~N> Info: ~w already loaded. Skipping.~n', [File])
; (
Expand Down
40 changes: 33 additions & 7 deletions output/wn_query.pl-Output-3.1

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions output/wn_valid.pl-Output-3.1
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ Morphological Info: [exc]
Loading prolog/wn_exc
> Consulting: prolog/wn_exc ... Done.

mk_ski executed in 0.11 seconds.
load_wn executed in 12.49 seconds.
mk_ski executed in 0.12 seconds.
Searching for ambiguous sense keys
OK

check_keys executed in 0.23 seconds.
check_keys executed in 0.22 seconds.
Loading prolog/wn_sk
> Info: prolog/wn_sk already loaded. Skipping.
Symmetric relations: [sim,ant,der,vgp]
Expand All @@ -83,7 +84,7 @@ Checking symmetry in vgp relation (wn_vgp.pl):
OK


symcheck executed in 0.27 seconds.
symcheck executed in 0.30 seconds.
Loading prolog/wn_g
> Info: prolog/wn_g already loaded. Skipping.
Asymmetric relations: [hyp,ins,mm,mp,ms,cls]
Expand Down Expand Up @@ -124,7 +125,7 @@ Looping cls-t:
OK


asymcheck executed in 0.12 seconds.
asymcheck executed in 0.13 seconds.

Empty (i.e. wordless) synsets:
OK
Expand Down
5 changes: 3 additions & 2 deletions timeit.pl
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@
% Measure the time taken to execute a given Goal once, and print the elapsed time.
current_time(StartTime),
call(Goal), % Always execute the Goal
Goal =.. [P|_],
(
StartTime == error
-> format('Timing unavailable for ~w.~n', [Goal])
-> format('Timing unavailable for ~w.~n', [P])
; current_time(EndTime),
Elapsed is EndTime - StartTime,
format('~w executed in ~2f seconds.~n', [Goal, Elapsed])
format('~w executed in ~2f seconds.~n', [P, Elapsed])
).
31 changes: 19 additions & 12 deletions wn2csv.pl
Original file line number Diff line number Diff line change
Expand Up @@ -49,44 +49,51 @@
%---------------------------------------------------------

spdx:-
write('# SPDX-License-Identifier: WordNet'),
wn_version(V),
format('# WordNet-Version: ~w~n', [V]),
atom_chars(V, [H,_,N|_]),
write('# SPDX-License-Identifier: WordNet'),
( H=='O' -> write(' AND CC-BY-4.0'); true ), nl,
write('# SPDX-FileCopyrightText: '),
( N=='0' -> write('2006'); write('2011') ),
format(' Princeton University~n'),
( H=='O' -> format('# SPDX-FileCopyrightText: 2025 Open English Wordnet Community~n'); true ),
write(' Princeton University'), nl,
( H=='O' -> write('# SPDX-FileCopyrightText: 2025 Open English Wordnet Community'), nl; true ),
write('# -----------------------------------------------------------'), nl.

pred2file(P):-
pred2file(P, Out):-
atom_concat('csv/wn_',P,C1),
atom_concat(C1,'.csv',C),
format('Writing ~w~n',[C]),
tell(C),
open(C, write, Out),
set_output(Out),
spdx.

out2csv(P):-
pred2file(P),
current_predicate(P/A),
convert_facts(P,A):-
dispatch_call(A,P,L),
args2csv(L,P,1),
false.
out2csv(_):-
told.
convert_facts(_,_).

out2csv(P):-
ensure_pred(P),
current_predicate(P/A),
pred2file(P, O),
convert_facts(P,A),
close(O).

convert_wn:-
allwn(L),
member(P,L),
ensure_pred(P),
out2csv(P),
false.
convert_wn.

inicsv:-
safe_consult(wn_load),
load_wn,
time_call(load_wn),
% loaded all dbs first, to time the conversion independently of consulting:
time_call(convert_wn).

:- initialization(inicsv).


Loading
Loading