Commit 9e7fa453 authored by Jerome Flesch's avatar Jerome Flesch

Rename module "cuneiform" into "cuneiform_sh"

Signed-off-by: Jerome Flesch's avatarJerome Flesch <jflesch@gmail.com>
parent 81c89d6e
......@@ -4,7 +4,7 @@ import sys
sys.path = [ "src" ] + sys.path
import unittest
from pyocr import cuneiform
from pyocr import cuneiform_sh
from pyocr import pyocr
from pyocr import tesseract_sh
......@@ -30,7 +30,7 @@ if __name__ == '__main__':
print("---")
print("Tesseract:")
unittest.TextTestRunner().run(tests_tesseract.get_all_tests())
if cuneiform.is_available():
if cuneiform_sh.is_available():
print("---")
print("Cuneiform:")
unittest.TextTestRunner().run(tests_cuneiform.get_all_tests())
......
......@@ -4,7 +4,7 @@ cuneiform.py is a wrapper for Cuneiform
USAGE:
> from PIL import Image
> from cuneiform import image_to_string
> from pyocr.cuneiform_sh import image_to_string
> print image_to_string(Image.open('test.png'))
> print image_to_string(Image.open('test-european.jpg'), lang='fra')
......
......@@ -45,7 +45,7 @@ WEBSITE:
https://github.com/jflesch/python-tesseract#readme
"""
from . import cuneiform
from . import cuneiform_sh
from . import tesseract_sh
__all__ = [
......@@ -57,7 +57,7 @@ __all__ = [
TOOLS = [ # in preference order
tesseract_sh,
cuneiform,
cuneiform_sh,
]
VERSION = (0, 3, 1)
......
......@@ -5,7 +5,7 @@ tesseract.py is a wrapper for google's Tesseract-OCR
USAGE:
> from PIL import Image
> from tesseract import image_to_string
> from pyocr.tesseract_sh import image_to_string
> print(image_to_string(Image.open('test.png')))
> print(image_to_string(Image.open('test-european.jpg'), lang='fra'))
......
......@@ -8,7 +8,7 @@ import tempfile
import unittest
from pyocr import builders
from pyocr import cuneiform
from pyocr import cuneiform_sh
class TestContext(unittest.TestCase):
......@@ -19,16 +19,16 @@ class TestContext(unittest.TestCase):
pass
def test_available(self):
self.assertTrue(cuneiform.is_available(),
self.assertTrue(cuneiform_sh.is_available(),
"cuneiform not found. Is it installed ?")
def test_version(self):
self.assertEqual(cuneiform.get_version(), (1, 1, 0),
self.assertEqual(cuneiform_sh.get_version(), (1, 1, 0),
("cuneiform does not have the expected version"
" (1.1.0) ! Tests will fail !"))
def test_langs(self):
langs = cuneiform.get_available_languages()
langs = cuneiform_sh.get_available_languages()
self.assertTrue("eng" in langs,
("English training does not appear to be installed."
" (required for the tests)"))
......@@ -59,7 +59,7 @@ class TestTxt(unittest.TestCase):
expected_output += line
expected_output = expected_output.strip()
output = cuneiform.image_to_string(Image.open(image_file), lang=lang)
output = cuneiform_sh.image_to_string(Image.open(image_file), lang=lang)
self.assertEqual(output, expected_output)
......@@ -92,7 +92,7 @@ class TestWordBox(unittest.TestCase):
expected_boxes = self.builder.read_file(file_descriptor)
expected_boxes.sort()
boxes = cuneiform.image_to_string(Image.open(image_file), lang=lang,
boxes = cuneiform_sh.image_to_string(Image.open(image_file), lang=lang,
builder=self.builder)
boxes.sort()
......@@ -119,7 +119,7 @@ class TestWordBox(unittest.TestCase):
self.__test_txt('test-french.jpg', 'test-french.words', 'fra')
def test_write_read(self):
original_boxes = cuneiform.image_to_string(
original_boxes = cuneiform_sh.image_to_string(
Image.open("tests/data/test.png"), builder=self.builder)
self.assertTrue(len(original_boxes) > 0)
......@@ -146,7 +146,7 @@ class TestWordBox(unittest.TestCase):
class TestOrientation(unittest.TestCase):
def test_can_detect_orientation(self):
self.assertFalse(cuneiform.can_detect_orientation())
self.assertFalse(cuneiform_sh.can_detect_orientation())
def get_all_tests():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment