Commit 33c26755 authored by Alexis Nasr's avatar Alexis Nasr
Browse files

ajout du champ index à la classe Word, il est mis à jour par la méthode add de WordBuffer

parent 806c85ad
......@@ -3,6 +3,7 @@ class Word:
self.featDic = {} # dictionnaire dans lequel sont stockés les word features
self.leftDaughters = [] # liste des indices des dépendants gauches
self.rightDaughters = [] # liste des indices des dépendants droits
self.index = invalidIndex()
def getFeat(self, featName):
if(not featName in self.featDic):
......@@ -20,6 +21,16 @@ class Word:
def addRightDaughter(self, index):
self.rightDaughters.append(index)
def getIndex(self) :
return self.index
def getRightDaughters(self):
return self.rightDaughters
def getLeftDaughters(self):
return self.leftDaughters
def affiche(self, mcd):
first = True
for columnNb in range(mcd.getNbCol()):
......@@ -46,6 +57,10 @@ class Word:
w.setFeat('GOV', '0')
return w
@staticmethod
def invalidIndex():
return 123456789
@staticmethod
def invalidGov():
return 123456789
......
......@@ -26,6 +26,7 @@ class WordBuffer:
self.addWord(Word.fakeWord())
def addWord(self, w):
self.index = len(self.array)
self.array.append(w)
def affiche(self, mcd):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment