diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2014-09-07 18:21:37 -0400 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2014-09-07 18:24:08 -0400 |
| commit | 0e8b0c88a4d3009cbbea695f606e49faef27f373 (patch) | |
| tree | 85a14a7aef3ee36e73544382c6fdec8aa6bd375c /web/utils.py | |
| parent | 74604d7b8ae98b125f1c800da753f8ab67474eb5 (diff) | |
| download | ocr-layer-curation-0e8b0c88a4d3009cbbea695f606e49faef27f373.tar.gz | |
Reorganize the code
hope I did it right. We have two packages now, one for the server
and one for the actual library.
Diffstat (limited to 'web/utils.py')
| -rw-r--r-- | web/utils.py | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/web/utils.py b/web/utils.py deleted file mode 100644 index 7e20858..0000000 --- a/web/utils.py +++ /dev/null @@ -1,20 +0,0 @@ -import djvu_utils as du -import sys -import string_utils as su -from wikisource import get_page - -def gen_html(book, page_number): - doc = du.get_document("../" + book) - page = doc.pages[int(page_number)-1] - d = du.parse_page(page) - corrected_text = get_page(book, int(page_number)) - corrected_words = su.simplify(corrected_text).split() - if d: - orig_words, orig_coords = zip(*d) - C = su.align(corrected_words, list(orig_words), list(orig_coords)) - corr_words = corrected_text.split() - orig_coords_html = du.convert_to_htmlcoord(orig_coords, page.size[1]) - return orig_coords_html, orig_words, corr_words, C[1] - -if __name__ == "__main__": - gen_html(*sys.argv[1:3]) |
