Skip to content

Commit 5c0c7a7

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into develop
2 parents 4477788 + 96ce74c commit 5c0c7a7

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@
201201
- Álvaro Justen <https://github.com/turicas>
202202
- bjut-hz
203203
- Sergio Oller
204+
- Izam Mohammed <https://github.com/izam-mohammed>
204205
- Will Monroe
205206
- Elijah Rippeth
206207
- Emil Manukyan

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Hi! Thanks for your interest in contributing to [NLTK](https://www.nltk.org/).
44
:-) You'll be joining a [long list of contributors](https://github.com/nltk/nltk/blob/develop/AUTHORS.md).
5-
In this document we'll try to summarize everything that you need to know to
5+
In this document, we'll try to summarize everything that you need to know to
66
do a good job.
77

88

@@ -36,7 +36,7 @@ Some priority areas for development are listed in the [NLTK Wiki](https://github
3636
We use [Git](https://git-scm.com/) as our [version control
3737
system](https://en.wikipedia.org/wiki/Revision_control), so the best way to
3838
contribute is to learn how to use it and put your changes on a Git repository.
39-
There's a plenty of documentation about Git -- you can start with the [Pro Git
39+
There's plenty of documentation about Git -- you can start with the [Pro Git
4040
book](https://git-scm.com/book/).
4141

4242

@@ -99,7 +99,7 @@ Summary of our git branching model:
9999
- If you have push access to the main repository, please do not commit directly
100100
to `develop`: your access should be used only to accept pull requests; if you
101101
want to make a new feature, you should use the same process as other
102-
developers so you code will be reviewed.
102+
developers so your code will be reviewed.
103103
- See [RELEASE-HOWTO.txt](RELEASE-HOWTO.txt) to see everything you
104104
need before creating a new NLTK release.
105105

nltk/grammar.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"expanding" *lhs* to *rhs* in *tree*.
7070
"""
7171
import re
72+
from collections import deque
7273
from functools import total_ordering
7374

7475
from nltk.featstruct import SLASH, TYPE, FeatDict, FeatStruct, FeatStructReader
@@ -771,15 +772,15 @@ def remove_unitary_rules(cls, grammar):
771772
lexical
772773
"""
773774
result = []
774-
unitary = []
775+
unitary = deque([])
775776
for rule in grammar.productions():
776777
if len(rule) == 1 and rule.is_nonlexical():
777778
unitary.append(rule)
778779
else:
779780
result.append(rule)
780781

781782
while unitary:
782-
rule = unitary.pop(0)
783+
rule = unitary.popleft()
783784
for item in grammar.productions(lhs=rule.rhs()[0]):
784785
new_rule = Production(rule.lhs(), item.rhs())
785786
if len(new_rule) != 1 or new_rule.is_lexical():

0 commit comments

Comments
 (0)