Commit 4fd9f50abe382729cda7f9e1c922842139c8604d
1 parent
bd996012
Exists in
master
and in
1 other branch
Implementa função skip no Iterator
Showing
2 changed files
with
4 additions
and
1 deletions
Show diff stats
src/new/Iterator.py
@@ -54,6 +54,9 @@ class Iterator(object): | @@ -54,6 +54,9 @@ class Iterator(object): | ||
54 | raise IndexError | 54 | raise IndexError |
55 | return self.list[self.count:self.count+n] | 55 | return self.list[self.count:self.count+n] |
56 | 56 | ||
57 | + def skip(self, n): | ||
58 | + self.count += n | ||
59 | + | ||
57 | def has_next(self): | 60 | def has_next(self): |
58 | if(self.count < self.size-1): | 61 | if(self.count < self.size-1): |
59 | self.count += 1 | 62 | self.count += 1 |
src/new/LerDicionarios.py
@@ -123,7 +123,7 @@ class LerDicionarios(object): | @@ -123,7 +123,7 @@ class LerDicionarios(object): | ||
123 | 123 | ||
124 | def carregar_verbos_ligacao(self): | 124 | def carregar_verbos_ligacao(self): |
125 | try: | 125 | try: |
126 | - self.file = csv.reader(open(self.path+" verbosLigacao.csv")) | 126 | + self.file = csv.reader(open(self.path+"verbosLigacao.csv")) |
127 | except IOError, (errno, strerror): | 127 | except IOError, (errno, strerror): |
128 | print "I/O error(%s): %s" % (errno, strerror) | 128 | print "I/O error(%s): %s" % (errno, strerror) |
129 | print "carregar_verbos_ligacao" | 129 | print "carregar_verbos_ligacao" |