Glossy 9: Interactive Paratext Interlineariser Lexicon Browser

The Rowbory/Nigeria Family Blog

Created with Sketch.

January 2023:

Revising glossy to work with Paratext 9.3 and to solve some display and security issues. Get in touch if you want a pre-release version as long as you are happy running python scripts yourself. Planning to make a self-contained executable this time round. Still needs a bit more work. I will release when it is generally usable by non-programers.

I also want to cross-link the lexicon with the interlinear xml files s we can count how many times and where certain glosses are used. Finally a simple editor to compact and remove dross from lexicon files is planned. Unclear when I’ll do that.


OLD DETAILS

Displays lexicons from Paratext interlinearizer in an easy searchable form.
Author: David Rowbory david_rowbory@sil.org
Version: 1.5.1 – June 2014
Copyright © 2011–2014 David Rowbory, Free software licensed under GPL v3. See COPYING.TXT.

For techies/contributors: here’s the source code repository and here’s the wiki. Thanks to Mark Gaddis for the original idea, Milt Jones, Jeremy Lang, John Heins and several others for ideas/bug-reports along the way. See the end of this doc for the recent changes.

Why might I want to use glossy?

If you’re a consultant using the Paratext interlineariser to account for vernacular words in a translation project and you would like to

  • Find related words based on searching for parts of either vernacular or glosses.
  • Show all the ways a word or related words have been glossed.
  • Search/sort for inconsistent spellings based on glosses.
  • Grab the file and put it in Excel to investigate it a bit more.

A live concordance and various other statistics would be nice, but I haven’t done that yet.

In slightly more detail…

Glossy shows you the quick lexicon generated from the interlinearizer. Here’s what you can do with it:

  • Search: Type anything in the search box at the top to search for it.
  • Starts with: Type one letter to show only words starting with that letter.
  • Sort: Click a column heading to search by that column.
    • (Sort from the end by double-clicking the search box; it will turn red. Double-click again to go back to sorting from the left.)
  • Find this: Click on any word to search for that word. Good for finding similar words.
  • Refresh to see recent changes: If you’ve made many changes to interlinearised text in Paratext, you can reload the list by telling the browser to refresh the page. (F5)
  • Copy to a table: Select all and copy and paste into a Microsoft Word table or anywhere else.
  • Give it to someone else: You can easily take the whole sortable, searchable lexicon to another computer by copying the whole glossy folder, complete with the appropriate xxx_Lexicon.xml file, where xxx is the Paratext project code.
    • If you remove any lexicon files you don’t want people to use, you’ll either have to tell people to load the lexicon.xml file directly or else edit the lex_list.html file to remove references to removed lexicons.

What it should look like:

Showing 3 different lexicons in: Firefox 12, Chrome 18, Internet Explorer 9.

An example of Glossy in several browsers

It looks nice on a Mac and on Linux too, but Paratext doesn’t run on a Mac except through Virtualization. It’s been designed so that you can make it a tall and slender window just to the side of Paratext. You could hide some of the menu bars and tool bars if you like.

How to install

  • Download Glossy-1.5.1 and extract the glossy folder anywhere you want on your computer.
  • [Optionally] Make a shortcut to the go.bat file and the display_glossies.html file from that folder and put them somewhere convenient.

How to run glossy

  • Open Paratext first.
    • Run the go.bat batch file. This watches for changes from Paratext.
  • Open the display_glossies.html file in FirefoxInternet Explorer or Safari (not Chrome).
    • (If you use Chrome, open the open_glossy_chrome.bat file.)
    • Then choose a language from the list at the top.

Special instructions and possible problems:

Some versions of Internet explorer need you to click Allow blocked content before it displays the table. 

Make sure the glossy folder is writeable. You’ll get a blank page and it won’t work unless glossy can actually copy files into the glossy folder.

Reporting problems and suggesting improvements

Please let me know if this version of glossy works well in your browsers, if you have problems or suggested improvements. I would especially like some more testing in other web browsers such as Opera, Internet Explorer 6, IE 7, IE 8 etc. Patches to the source code would be appreciated and may be included. There is a lot of scope for improvement, but the primary design goal is a minimalist, uncluttered user interface. I haven’t consciously optimised the code for speed and haven’t needed to yet, but I could do that if a problem is demonstrated.

Email: glossy@m.rowbory.co.uk

Changelog

1.5 (June 2014)

  • made the run_glossy_watcher batch file more robust, renamed it go.bat (Thanks to Milt Jones for ideas)

  • added sort from right/end (Thanks to John Heins for the suggestion)

1.4 (July 2012)

  • display_glossies.html: unnecessary scrollbars removed

1.3 (June 2012)

  • Removed faulty encryption set on some subfolders which generated spurious error messages.
  • Reworked batch file to work on 64 bit machines. You can also see in the batch file how you could make it work for installation in other places.

1.2 (May 2012)

  • Removed unnecessary restriction about where glossy folder needed to be. It should run happily anywhere.
  • Works with Internet Explorer and Firefox.
  • Added Chrome option (works with Chrome at least on 18). Run the open_glossy_chrome.bat file.
  • Adjusted appearance, moving the search box and adding various status info to show what is being searched for (status bar) and how many hits there are (to the right of the search box).
  • If the main language doesn’t have any words beginning with a single letter typed, then we look for glosses that begin with that letter.
  • Updated documentation.

1.1 (March 2012)

  • Infrastructure to watch for Paratext closing and stop automatically but no good way of doing this!
  • Less chatty display, but shows more useful info.
  • Separated css from xsl.
  • Better commenting and docs.
  • Excludes blank or nearly empty Lexicon.xml files

Developer Notes

Requirements, Dependencies & Testing

  • Uses the version of Python that comes bundled with Paratext. If this changes, then this tool may break. As of Paratext 7.1-4 this was Python 2.4, which is getting a little old now but is quite sufficient for this task.
  • Uses standard SIL fonts Andika and Charis, if possible. Make sure these are installed for best appearance or change glossy.css.

Browser settings

  • Safari: seems to work well.
  • Internet Explorer:
    • User may need to click an Allow this content button.
    • I think that the inserted HTML for highlighting gets mangled because of differences in whether HTML codes are escaped or not.
    • Firefox: may just work.
      • Otherwise investigate property: security.fileuri.strict_origin_policy
    • Chrome: won’t work from v5:
      • Unless you start Chrome with the open_glossy_chrome.bat batch file.

References:

Ideas for future development of glossy and related tools

  • Gloss concordance tool to show exactly where (in the xxx_Interlinear.xml files) each gloss occurs and count occurrences.
  • Offline (Paratext closed) tool for merging near-duplicate gloss entries.
  • Import to FieldWorks or WeSay.

Related Tools in development

GAB: Gimme A Break

  • Analyses possible mistakes in word division based on scripture text. Good for new writers.

ATBE: All Things Being Equal

  • Analyses where lookalike characters have been used in Paratext projects (or other text files) and helps you make the characters consistent across all files, either in Unicode NFC or NFD.

APL: Analyse Paratext Log

  • Summarises the activity each day from the Paratext Log, to back up work logs.
  • Other kinds of analysis could be useful too.

Comments: 8

  1. david says:

    Some deficiencies that have been noted:

    It assumes Paratext is at C:\Program Files\Paratext 7 (not true on 64 bit machines and some others) and that the My Paratext Projects folder is on the root of C:\. Also ie9’s security settings may prevent anything displaying.

  2. Richard Syed says:

    Does Glossy work with Paratext 7.4 and Windows 8.1?

    • david says:

      Certainly works with Paratext 7.4 and 7.5 (beta), and I would expect with Windows 8.1, but I’ll need to find a 8.1 computer and check it for you. What is unfortunately true is that I haven’t had time to write a really convenient installer and executable to get it working.

    • david says:

      See my reply to JF above. Rewriting the go.bat file might help, possibly like this:

      (change all nice WordPress “curly double quotes” to straight ones please and put this text in a batch file)

      SET py_exe=”C:\Program Files (x86)\Paratext 7\python24\python.exe”
      SET mpp=”C:\My Paratext Projects”
      %py_exe% glossy.py “%mpp%\”

  3. Richard Syed says:

    Thank you. I installed the two files and created short cuts and made the folder writable, but the page is empty.

    No hurry – but please let me know when you have written the installer an executable, so that I can try again.

    • david says:

      Can you let me know what browser you were using? Did the ‘go.bat’ file seem to do anything or display any messages? It should remain open for a minute or so doing processing and then (as long as Paratext is open) stick around watching for changes to your lexicons.

  4. JF says:

    Running ParaText 7.5.100.61 on Win 8
    Paratext is installed to D:\My Paratext Projects
    Running ‘go.bat’ yields the following message:
    ERROR: The system was unable to find the specified registry key or value.
    The syntax of the command is incorrect.
    So, peeking to see what Key it was looking for, I added the key:
    HKEY_LOCAL_MACHINE\SOFTWARE\ScrChecks\1.0\Program_Files_Directory_Ptw7
    and set the default value to “C:\Program Files (x86)\Paratext 7”
    Running ‘go.bat’ now yielded the following message:
    I can’t find the ‘Paratext 7’ folder
    After that, I edited glossy.py to reflect “D” instead of “C” on line 98. Got same result.
    Then I manually added the Environment variable py_exe=C:\Program Files (x86)\Paratext 7\Python24\python.exe
    Still the same result. Got any ideas?

    • david says:

      Thanks for the detail. The easiest thing to do would be to replace registry lookups with the exact details on your machine. At its heart all the go.bat file needs to do is:
      %py_exe% glossy.py “%mpp%\”

      to start the program in python. You just need py_exe to be something like “C:\Program Files (x86)\Paratext 7\python24\python.exe” and mpp to be “C:\My Paratext Projects”

      Most of the stuff in go.bat is my attempt to find out where things are on the machine and launch it appropriately. Most of the trouble with glossy relates to this batch file!

      Incidentally you could run the glossy.py file on any operating system, passing it the My Paratext Projects folder so it can find its way to the lexicons – not just Windows.

Add your comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.