mirror of
https://github.com/wassname/pysle.git
synced 2026-06-27 16:10:05 +08:00
BUGFIX: Python 3.x compability
Changed xrange -> range Also added some documentation and changed the version number.
This commit is contained in:
+10
-4
@@ -3,6 +3,9 @@
|
||||
pysle
|
||||
---------
|
||||
|
||||
.. image:: https://img.shields.io/badge/license-MIT-blue.svg?
|
||||
:target: http://opensource.org/licenses/MIT
|
||||
|
||||
Pronounced like 'p' + 'isle'.
|
||||
|
||||
An interface for the ILSEX (international speech lexicon) dictionary,
|
||||
@@ -76,10 +79,13 @@ Requirements
|
||||
Installation
|
||||
================
|
||||
|
||||
From a command-line shell, navigate to the directory this is located in
|
||||
and type::
|
||||
If you on Windows, you can use the installer found here (check that it is up to date though)::
|
||||
|
||||
python setup.py install
|
||||
`Windows installer <http://www.timmahrt.com/python_installers>`_
|
||||
|
||||
Otherwise, to manually install, after downloading, from a command-line shell, navigate to the directory containing setup.py and type::
|
||||
|
||||
python setup.py install
|
||||
|
||||
If python is not in your path, you'll need to enter the full path e.g.::
|
||||
|
||||
@@ -111,7 +117,7 @@ and another::
|
||||
>> [["''"], ['n', '@'], ['th', 'r']]
|
||||
|
||||
|
||||
Please see \\test for example usage
|
||||
Please see \\examples for example usage
|
||||
|
||||
|
||||
Citing pysle
|
||||
|
||||
@@ -243,16 +243,16 @@ def alignPronunciations(pronI, pronA):
|
||||
|
||||
# Fill in any blanks such that the sequential items have the same
|
||||
# index and the two strings are the same length
|
||||
for x in xrange(len(sequenceIndexListA)):
|
||||
for x in range(len(sequenceIndexListA)):
|
||||
indexA = sequenceIndexListA[x]
|
||||
indexI = sequenceIndexListI[x]
|
||||
if indexA < indexI:
|
||||
for x in xrange(indexI - indexA):
|
||||
for x in range(indexI - indexA):
|
||||
pronA.insert(indexA, "''")
|
||||
sequenceIndexListA = [val + indexI - indexA
|
||||
for val in sequenceIndexListA]
|
||||
elif indexA > indexI:
|
||||
for x in xrange(indexA - indexI):
|
||||
for x in range(indexA - indexI):
|
||||
pronI.insert(indexI, "''")
|
||||
sequenceIndexListI = [val + indexA - indexI
|
||||
for val in sequenceIndexListI]
|
||||
|
||||
Reference in New Issue
Block a user