Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate ILI links #1122

Merged
merged 2 commits into from
Oct 21, 2024
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
7 changes: 7 additions & 0 deletions scripts/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ def main():
errors += 1

instances = set()
ilis = set()

for synset in wn.synsets:
if synset.id[-1:] != synset.part_of_speech.value:
Expand Down Expand Up @@ -374,6 +375,12 @@ def main():
(synset.id, item[1], item[0]))
errors += 1

if synset.ili != "in" and synset.ili in ilis:
print(f"ERROR: ILI {synset.ili} is duplicated")
errors += 1
else:
ilis.add(synset.ili)

for synset in wn.synsets:
for sr in synset.synset_relations:
if sr.rel_type == SynsetRelType.HYPERNYM:
Expand Down
2 changes: 1 addition & 1 deletion scripts/wordnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def change_sense_id(self, sense, new_id):
self.sense2synset[new_id] = sense.synset
self.id2sense[new_id] = sense

def to_xml(self, xml_file, part=True):
def to_xml(self, xml_file, part=False):
xml_file.write("""<?xml version="1.0" encoding="UTF-8"?>\n""")
if part:
xml_file.write(
Expand Down
2 changes: 0 additions & 2 deletions src/yaml/adj.all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2222,7 +2222,6 @@
- 08215965-n
example:
- a newly activated unit
ili: i216
members:
- activated
partOfSpeech: s
Expand Down Expand Up @@ -53180,7 +53179,6 @@
- a scenic but devious route
- a long and circuitous journey by train and boat
- a roundabout route avoided rush-hour traffic
ili: i4234
members:
- devious
- circuitous
Expand Down
1 change: 0 additions & 1 deletion src/yaml/noun.act.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51679,7 +51679,6 @@
- the mastery of fire was a huge advance in human technology
hypernym:
- 00950950-n
ili: i40396
members:
- technology
partOfSpeech: n
Expand Down
1 change: 0 additions & 1 deletion src/yaml/verb.cognition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5002,7 +5002,6 @@
- Her agent had booked her for several concerts in Tokyo
hypernym:
- 00680201-v
ili: i34688
members:
- book
partOfSpeech: v
Expand Down
Loading