Skip to content

Commit

Permalink
skipping empty feature vector
Browse files Browse the repository at this point in the history
git-svn-id: https://ilk.uvt.nl/svn/trunk/sources/pynlpl@13351 12f355fe-0486-481a-ad91-c297ab22b4e3
  • Loading branch information
proycon committed Sep 30, 2011
1 parent 6fbcc08 commit d213db1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions formats/dutchsemcor.py
Expand Up @@ -123,11 +123,12 @@ def senses(self, bestonly=False):

def loadfromtimbl(self, filename):
timbloutput = TimblOutput(codecs.open(filename,'r','utf-8'))
for features, referenceclass, predictedclass, distribution, distance in timbloutput:
for i, (features, referenceclass, predictedclass, distribution, distance) in enumerate(timbloutput):
if distance != None:
distance='+vdi'+str(distance)
if len(features) == 0:
print >>stderr, "Empty feature vector in " + filename
print >>stderr, "WARNING: Empty feature vector in " + filename + " (line " + str(i+1) + ") skipping!!"
continue
word_id = features[0] #note: this is an assumption that must be adhered to!
if distribution:
self.append(word_id, distribution,distance)
Expand Down

0 comments on commit d213db1

Please sign in to comment.