Skip to content

Commit

Permalink
Merge branch 'master' of github.com:chrislit/narmer
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislit committed Sep 13, 2015
2 parents 1d7229d + c5ad976 commit b022a37
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
@@ -1,7 +1,12 @@
language: python
python:
#- pypy
- 2.7
- 3.3
- 3.4
#- 3.5-dev
#- nightly
#- pypy3

# Install packages
install:
Expand Down
9 changes: 4 additions & 5 deletions HISTORY.rst
@@ -1,14 +1,13 @@
Release History
---------------

0.1.0 (2015-04-22)
0.1.1 (2015-05-12)
++++++++++++++++++

First Pre-Alpha commits to GitHub
First Alpha release to PyPI


0.1.1 (2015-05-12)
0.1.0 (2015-04-22)
++++++++++++++++++

First Alpha release to PyPI

First Pre-Alpha commits to GitHub
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -12,7 +12,7 @@ Narmer
:target: https://codeclimate.com/github/chrislit/narmer
:alt: Code Climate

.. image:: https://img.shields.io/badge/Pylint-9.95/10-green.svg
.. image:: https://img.shields.io/badge/Pylint-9.97/10-green.svg
:alt: Pylint Score

.. image:: https://img.shields.io/badge/PEP8-0-brightgreen.svg
Expand Down
22 changes: 22 additions & 0 deletions narmer/phonetic.py
Expand Up @@ -45,6 +45,17 @@ def german_ipa(word, period="nhg"):
:returns: the German word's approximate IPA equivalent
:rtype: str
>>> german_ipa('Ehre')
'ere'
>>> german_ipa('Kohl')
'kol'
>>> german_ipa('Schifffahrt')
'ʃifffart'
>>> german_ipa('Schiller')
'ʃiller'
>>> german_ipa('Tschechien')
'tʃeçin'
"""
period_map = {'nhg': nhg_ipa,
'enhg': enhg_ipa,
Expand All @@ -70,6 +81,17 @@ def nhg_ipa(word):
:param str word: the NHG word to transcribe to IPA
:returns: the NHG word's approximate IPA equivalent
:rtype: str
>>> nhg_ipa('Ehre')
'ere'
>>> nhg_ipa('Kohl')
'kol'
>>> nhg_ipa('Schifffahrt')
'ʃifffart'
>>> nhg_ipa('Schiller')
'ʃiller'
>>> nhg_ipa('Tschechien')
'tʃeçin'
"""
# pylint: disable=too-many-branches
_vowels = frozenset('AEIOUYÄÖÜ')
Expand Down
11 changes: 11 additions & 0 deletions narmer/stats.py
Expand Up @@ -50,6 +50,17 @@ def weissman(r_tar, t_tar, r_src, t_src, alpha=1.0):
:param float alpha: a scaling constant (1.0 by default)
:returns: the Weissman score
:rtype: float
>>> weissman(1, 1, 1, 1)
1.0
>>> weissman(1, 1, 1, 5)
7248263982714164.0
>>> weissman(1.2, 1.6, 4.8, 5)
0.8560773855177113
>>> weissman(1, 1, 1, 1, alpha=2)
2.0
>>> weissman(1.2, 1.6, 4.8, 5, alpha=2)
1.7121547710354226
"""
if t_tar <= 0 or t_src <= 0:
raise ValueError("Compression times must be positive values.")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_phonetic.py
Expand Up @@ -77,7 +77,7 @@ def test_german_ipa(self):
self.assertEqual(german_ipa('Bezsch'), 'betʃ')
self.assertEqual(german_ipa('Zimmer'), 'tsimmer')
self.assertEqual(german_ipa('Eichhorn'), 'aiçhorn')
self.assertEqual(german_ipa('Löwenbräu'), 'løvenbroy')
self.assertEqual(german_ipa('Löwenbräu'), 'løvenbrøy')
self.assertEqual(german_ipa('graue'), 'graue')
self.assertEqual(german_ipa('singen'), 'ziŋen')
self.assertEqual(german_ipa('Volk'), 'folk')
Expand Down

0 comments on commit b022a37

Please sign in to comment.