Skip to content

Commit

Permalink
Update v2.2.x for bugfix release (#6384)
Browse files Browse the repository at this point in the history
* Fix on_match callback and remove empty patterns (#6312)

For the `DependencyMatcher`:

* Fix on_match callback so that it is called once per matched pattern
* Fix results so that patterns with empty match lists are not returned

* Add --prefer-binary for python 3.5

* Add version pins for pyrsistent

* Use backwards-compatible super()

* Try to fix tests on Travis (2.7)

* Fix naming conflict and formatting

* Update pkuseg version in Chinese tokenizer warnings

* Some changes for Armenian (#5616)

* Fixing numericals

* We need a Armenian question sign to make the sentence a question

* Update lex_attrs.py (#5608)

* Fix compat

* Update Armenian from v2.3.x

Co-authored-by: Ines Montani <ines@ines.io>
Co-authored-by: Karen Hambardzumyan <mahnerak@gmail.com>
Co-authored-by: Marat M. Yavrumyan <myavrum@ysu.am>
  • Loading branch information
4 people committed Nov 14, 2020
1 parent a41e28c commit ada4fc0
Show file tree
Hide file tree
Showing 15 changed files with 209 additions and 383 deletions.
6 changes: 3 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ jobs:
architecture: 'x64'

- script: |
python -m pip install -U setuptools
pip install -r requirements.txt
python -m pip install -U pip setuptools
pip install -r requirements.txt --prefer-binary
displayName: 'Install dependencies'
- script: |
Expand All @@ -96,7 +96,7 @@ jobs:

- bash: |
SDIST=$(python -c "import os;print(os.listdir('./dist')[-1])" 2>&1)
pip install dist/$SDIST
pip install dist/$SDIST --prefer-binary
displayName: 'Install from sdist'
- script: python -m pytest --pyargs spacy
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ plac>=0.9.6,<1.2.0
pathlib==1.0.1; python_version < "3.4"
tqdm>=4.38.0,<5.0.0
# Optional dependencies
pyrsistent<0.17.0
jsonschema>=2.6.0,<3.1.0
# Development dependencies
cython>=0.25
Expand Down
4 changes: 2 additions & 2 deletions spacy/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ def add_codes(err_cls):

class ErrorsWithCodes(err_cls):
def __getattribute__(self, code):
msg = super().__getattribute__(code)
if code.startswith('__'): # python system attributes like __class__
msg = super(ErrorsWithCodes, self).__getattribute__(code)
if code.startswith("__"): # python system attributes like __class__
return msg
else:
return "[{code}] {msg}".format(code=code, msg=msg)
Expand Down
5 changes: 3 additions & 2 deletions spacy/lang/hy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# coding: utf8
from __future__ import unicode_literals

from .stop_words import STOP_WORDS
from .lex_attrs import LEX_ATTRS
from .tag_map import TAG_MAP


from ...attrs import LANG
from ...language import Language
from ...tokens import Doc


class ArmenianDefaults(Language.Defaults):
Expand Down
4 changes: 2 additions & 2 deletions spacy/lang/hy/examples.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding: utf8
from __future__ import unicode_literals


"""
Example sentences to test spaCy and its language models.
>>> from spacy.lang.hy.examples import sentences
Expand All @@ -11,6 +11,6 @@
sentences = [
"Լոնդոնը Միացյալ Թագավորության մեծ քաղաք է։",
"Ո՞վ է Ֆրանսիայի նախագահը։",
"Որն է Միացյալ Նահանգների մայրաքաղաքը։",
"Ո՞րն է Միացյալ Նահանգների մայրաքաղաքը։",
"Ե՞րբ է ծնվել Բարաք Օբաման։",
]
26 changes: 14 additions & 12 deletions spacy/lang/hy/lex_attrs.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# coding: utf8
from __future__ import unicode_literals

from ...attrs import LIKE_NUM


_num_words = [
"զրօ",
"մէկ",
"զրո",
"մեկ",
"երկու",
"երեք",
"չորս",
Expand All @@ -17,20 +18,21 @@
"տասը",
"տասնմեկ",
"տասներկու",
"տասն­երեք",
"տասն­չորս",
"տասն­հինգ",
"տասն­վեց",
"տասն­յոթ",
"տասն­ութ",
"տասն­ինը",
"քսան" "երեսուն",
"տասներեք",
"տասնչորս",
"տասնհինգ",
"տասնվեց",
"տասնյոթ",
"տասնութ",
"տասնինը",
"քսան",
"երեսուն",
"քառասուն",
"հիսուն",
"վաթցսուն",
"վաթսուն",
"յոթանասուն",
"ութսուն",
"ինիսուն",
"իննսուն",
"հարյուր",
"հազար",
"միլիոն",
Expand Down
4 changes: 2 additions & 2 deletions spacy/lang/hy/stop_words.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding: utf8
from __future__ import unicode_literals


STOP_WORDS = set(
"""
նա
Expand Down Expand Up @@ -105,6 +105,6 @@
յուրաքանչյուր
այս
մեջ
թ
թ
""".split()
)
Loading

0 comments on commit ada4fc0

Please sign in to comment.