Skip to content

Commit 1be3668

Browse files
authored
Merge pull request #1122 from globalwordnet/issue-1121
Remove duplicate ILI links
2 parents 36f6272 + fb8f0e2 commit 1be3668

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

scripts/validate.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ def main():
277277
errors += 1
278278

279279
instances = set()
280+
ilis = set()
280281

281282
for synset in wn.synsets:
282283
if synset.id[-1:] != synset.part_of_speech.value:
@@ -374,6 +375,12 @@ def main():
374375
(synset.id, item[1], item[0]))
375376
errors += 1
376377

378+
if synset.ili != "in" and synset.ili in ilis:
379+
print(f"ERROR: ILI {synset.ili} is duplicated")
380+
errors += 1
381+
else:
382+
ilis.add(synset.ili)
383+
377384
for synset in wn.synsets:
378385
for sr in synset.synset_relations:
379386
if sr.rel_type == SynsetRelType.HYPERNYM:

scripts/wordnet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def change_sense_id(self, sense, new_id):
102102
self.sense2synset[new_id] = sense.synset
103103
self.id2sense[new_id] = sense
104104

105-
def to_xml(self, xml_file, part=True):
105+
def to_xml(self, xml_file, part=False):
106106
xml_file.write("""<?xml version="1.0" encoding="UTF-8"?>\n""")
107107
if part:
108108
xml_file.write(

src/yaml/adj.all.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2222,7 +2222,6 @@
22222222
- 08215965-n
22232223
example:
22242224
- a newly activated unit
2225-
ili: i216
22262225
members:
22272226
- activated
22282227
partOfSpeech: s
@@ -53180,7 +53179,6 @@
5318053179
- a scenic but devious route
5318153180
- a long and circuitous journey by train and boat
5318253181
- a roundabout route avoided rush-hour traffic
53183-
ili: i4234
5318453182
members:
5318553183
- devious
5318653184
- circuitous

src/yaml/noun.act.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51679,7 +51679,6 @@
5167951679
- the mastery of fire was a huge advance in human technology
5168051680
hypernym:
5168151681
- 00950950-n
51682-
ili: i40396
5168351682
members:
5168451683
- technology
5168551684
partOfSpeech: n

src/yaml/verb.cognition.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5002,7 +5002,6 @@
50025002
- Her agent had booked her for several concerts in Tokyo
50035003
hypernym:
50045004
- 00680201-v
5005-
ili: i34688
50065005
members:
50075006
- book
50085007
partOfSpeech: v

0 commit comments

Comments
 (0)