Skip to content

Commit

Permalink
updated names for latest pep8-naming
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislit committed Jan 30, 2019
1 parent d01a85f commit 7f2de8a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ Abydos
:target: #
:alt: Pylint Score

.. |flake8| image:: https://img.shields.io/badge/flake8-29-yellowgreen.svg
.. |flake8| image:: https://img.shields.io/badge/flake8-2-green.svg
:target: #
:alt: flake8 Errors

.. |pydocstyle| image:: https://img.shields.io/badge/pydocstyle-16-yellowgreen.svg
.. |pydocstyle| image:: https://img.shields.io/badge/pydocstyle-0-brightgreen.svg
:target: #
:alt: pydocstyle Errors

Expand Down
7 changes: 4 additions & 3 deletions abydos/tokenizer/_legalipy.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@
from ._tokenizer import _Tokenizer

try:
from syllabipy.legalipy import getOnsets, LegaliPy
from syllabipy.legalipy import LegaliPy
from syllabipy.legalipy import getOnsets as gen_onsets # noqa: N813
except ImportError: # pragma: no cover
# If the system lacks the SyllabiPy library, that's fine, but SyllabiPy
# tokenization won't be supported.
getOnsets = None
gen_onsets = None
LegaliPy = None


Expand Down Expand Up @@ -92,7 +93,7 @@ def train_onsets(self, text, threshold=0.0002, clean=True, append=False):
.. versionadded:: 0.4.0
"""
new_onsets = getOnsets(text, threshold, clean)
new_onsets = gen_onsets(text, threshold, clean)
if append:
self._onsets = list(set(self._onsets + new_onsets))
else:
Expand Down
6 changes: 3 additions & 3 deletions tests/corpus/test_corpus_corpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
class CorpusTestCases(unittest.TestCase):
"""Test Corpus class."""

sotu2015Sample = 'Mr. Speaker, Mr. Vice President, Members of Congress, my\
fellow Americans:\n\nWe are 15 years into this new century.\n Fifteen\
sotu2015_sample = 'Mr. Speaker, Mr. Vice President, Members of Congress,\
my fellow Americans:\n\nWe are 15 years into this new century.\n Fifteen\
years that dawned with terror touching our shores; that unfolded with a\
new generation fighting two long and costly wars; that saw a vicious\
recession spread across our nation and the world.\n It has been, and still\
Expand Down Expand Up @@ -73,7 +73,7 @@ class CorpusTestCases(unittest.TestCase):
crisscross the country making a case for those ideas.\n So tonight, I want\
to focus less on a checklist of proposals, and focus more on the values at\
stake in the choices before us.'
sotu2015Corpus = Corpus(sotu2015Sample, filter_chars='.?-;,:')
sotu2015_corpus = Corpus(sotu2015_sample, filter_chars='.?-;,:')

def test_corpus(self):
"""Test abydos.corpus.Corpus."""
Expand Down
14 changes: 7 additions & 7 deletions tests/corpus/test_corpus_n_gram_corpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class NGramCorpusTestCases(unittest.TestCase):
double_corpus.gng_importer(_corpus_file('simple-ngrams.txt'))
double_corpus.gng_importer(_corpus_file('simple-ngrams.txt'))

sotu2015Sample = 'Mr. Speaker, Mr. Vice President, Members of Congress, my\
fellow Americans:\n\nWe are 15 years into this new century.\n Fifteen\
sotu2015_sample = 'Mr. Speaker, Mr. Vice President, Members of Congress,\
my fellow Americans:\n\nWe are 15 years into this new century.\n Fifteen\
years that dawned with terror touching our shores; that unfolded with a\
new generation fighting two long and costly wars; that saw a vicious\
recession spread across our nation and the world.\n It has been, and still\
Expand Down Expand Up @@ -84,15 +84,15 @@ class NGramCorpusTestCases(unittest.TestCase):
crisscross the country making a case for those ideas.\n So tonight, I want\
to focus less on a checklist of proposals, and focus more on the values at\
stake in the choices before us.'
sotu2015Corpus = Corpus(sotu2015Sample, filter_chars='.?-;,:')
sotu2015_corpus = Corpus(sotu2015_sample, filter_chars='.?-;,:')

sotu_ngcorpus_uni = NGramCorpus(sotu2015Corpus)
sotu_ngcorpus_uni = NGramCorpus(sotu2015_corpus)

sotu_ngcorpus_tri = NGramCorpus()
sotu_ngcorpus_tri.corpus_importer(sotu2015Corpus, 3, '<SOS>', '<EOS>')
sotu_ngcorpus_tri.corpus_importer(sotu2015_corpus, 3, '<SOS>', '<EOS>')

sotu_ngcorpus_5 = NGramCorpus()
sotu_ngcorpus_5.corpus_importer(sotu2015Corpus, 5, '', '')
sotu_ngcorpus_5.corpus_importer(sotu2015_corpus, 5, '', '')

simple_ngcorpus_5 = NGramCorpus()
simple_ngcorpus_5.corpus_importer(
Expand All @@ -103,7 +103,7 @@ def test_init(self):
"""Test abydos.corpus.NGramCorpus.__init__."""
self.assertIsInstance(NGramCorpus(), NGramCorpus)
self.assertRaises(TypeError, NGramCorpus, ['a', 'b', 'c'])
self.assertIsInstance(NGramCorpus(self.sotu2015Corpus), NGramCorpus)
self.assertIsInstance(NGramCorpus(self.sotu2015_corpus), NGramCorpus)

def test_corpus_importer(self):
"""Test abydos.corpus.NGramCorpus.corpus_importer."""
Expand Down

0 comments on commit 7f2de8a

Please sign in to comment.