moreymat / omw-graph

The Open Multilingual Wordnet in a graph database
MIT License
4 stars 0 forks source link

Relations skipped #15

Closed rhin0cer0s closed 10 years ago

rhin0cer0s commented 10 years ago

Some relations are skipped when adding missing synsets.

if not currentid in synsets:
  writeLineSynset(currentid, syncsv)
  synsets[currentid].append(currentid)
  if not targetid in synsets:
    writeLineSynset(targetid, syncsv)
    synsets[targetid].append(targetid)
writeLineRels(currentid, targetid, reltype, relcsv)

synsets is a collection used to know if a synset has been added or not. If not I print it in syn-xxx.csv and add it to synsets. I do it for every relation.

This way there should be no missing synset and only right relations but some are still skipped 5 on more than 200.000

rhin0cer0s commented 10 years ago

Found it. Some targetid are used before being currentid ( obvious ). So I just changed the previous line to :

if not currentid in synsets:
  writeLineSynset(currentid, syncsv)
  synsets[currentid].append(currentid)
if not targetid in synsets:
  writeLineSynset(targetid, syncsv)
  synsets[targetid].append(targetid)
writeLineRels(currentid, targetid, reltype, relcsv)