Jump to content

Parsers: Greek and Latin parser for Alfred


Recommended Posts

Parsers

Greek and Latin parsers for Alfred

Version: 2.0

Download at Packal

This is a somewhat specialized workflow, but for those who read Greek and Latin, it will likely prove beneficial. This workflow uses the Perseus parsing backend to allow full parsing of both Greek and Latin terms. Simply use the keyword parse followed by the unknown Greek or Latin word. Parsers will automatically fetch all of the parsing data from Perseus, munch it up, and offer you all of the possible parsings via Alfred's elegant UI.

alfred_parser.png

If you would like a bit more information, Parsers adds two actions for any selected parsing. Using cmd+return, you can view a HUD of the parsing data chosen, pretty printed, and have that data copied to the clipboard.

Greek: greek_parse.png

Latin: latin_parse.png

Alternatively, you can use shift+return to view a HUD of the lexicon entry for that parsing term, and this lexicon data will also be copied to the clipboard (NOTE: Parsers will attempt to display the lexicon entry from the most concise lexicon available for the chosen term).

Greek: greek_lexicon.png

Latin: latin_lexicon.png

Let me know if you have any further feature suggestions. And enjoy your Greek and Latin,

stephen

Edited by smarg19
Link to comment
  • 4 months later...

UPDATE: I have just pushed version 2.0 to Packal. This is a total rewrite, but it keeps the essential UI. Use a keyboard shortcut or the Script Filter to get parsing options. Then, either [1] directly copy that parsing info, [2] copy a nicely formatted version of the parsing info, or [3] (this is the newest part) look up that lemma in a lexicon.

The lexicon lookup with show a webview with a cleaned-up, well-formatted version of the lexicon entry. This text is selectable and copyable, and is much easier to read than on Perseus' website.

This is a great update. Hope you like it,

stephen

Link to comment
  • 2 months later...

Thanks for sharing this interesting workflow. However, i get an error when I try to run it: 'nonetype' object is not iterable. I'm running Yosemite, maybe that's why? Incidentally, when I first run it, I was asked to authorize something (sorry but I don't remember what exactly) to always run. Is that normal? Thank you!

Link to comment

Can you run the workflow with Alfred's debugger on, and then post the debugger output? I need specific line numbers and such. Also, the authorization was to download a dependency. I'm using an early version of a workflow utility to allow workflows to download utilities at runtime, instead of bundling them all with the workflow. This reduces the size of the workflow itself, and thus alleviates user's Dropboxes (if they are syncing).

Link to comment

Thank you so much for the prompt reply. Here goes, enjoy:

 

Starting debug for 'Parsers'

 
[ERROR: alfred.workflow.input.scriptfilter] Code 1: 15:48:13 parser.py:369 DEBUG    {u'<argument>': u'noun sg masc nom',
 u'<flag>': u'lexica',
 u'display': False,
 u'launch': True,
 u'search': False}
15:48:13 parser.py:104 DEBUG    Running launch_codepath...
15:48:13 workflow.py:1832 ERROR    'NoneType' object is not iterable
Traceback (most recent call last):
  File "/Users/*/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.FF230D30-ADBD-480A-A904-7448BCD6D718/workflow/workflow.py", line 1830, in run
    func(self)
  File "parser.py", line 371, in main
    res = pd.run(args)
  File "parser.py", line 107, in run
    return method()
  File "parser.py", line 359, in launch_codepath
    self.log_vocab(self._chosen_item())
  File "parser.py", line 263, in _chosen_item
    for item in parsing_data
TypeError: 'NoneType' object is not iterable
[ERROR: alfred.workflow.input.scriptfilter] Code 1: 15:48:13 parser.py:369 DEBUG    {u'<argument>': u'noun sg masc nom',
 u'<flag>': u'lexica',
 u'display': False,
 u'launch': True,
 u'search': False}
15:48:13 parser.py:104 DEBUG    Running launch_codepath...
15:48:13 workflow.py:1832 ERROR    'NoneType' object is not iterable
Traceback (most recent call last):
  File "/Users/*/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.FF230D30-ADBD-480A-A904-7448BCD6D718/workflow/workflow.py", line 1830, in run
    func(self)
  File "parser.py", line 371, in main
    res = pd.run(args)
  File "parser.py", line 107, in run
    return method()
  File "parser.py", line 359, in launch_codepath
    self.log_vocab(self._chosen_item())
  File "parser.py", line 263, in _chosen_item
    for item in parsing_data
TypeError: 'NoneType' object is not iterable
[ERROR: alfred.workflow.input.scriptfilter] Code 1: 15:48:13 parser.py:369 DEBUG    {u'<argument>': u'noun sg masc nom',
 u'<flag>': u'lexica',
 u'display': False,
 u'launch': True,
 u'search': False}
15:48:13 parser.py:104 DEBUG    Running launch_codepath...
15:48:13 workflow.py:1832 ERROR    'NoneType' object is not iterable
Traceback (most recent call last):
  File "/Users/*/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.FF230D30-ADBD-480A-A904-7448BCD6D718/workflow/workflow.py", line 1830, in run
    func(self)
  File "parser.py", line 371, in main
    res = pd.run(args)
  File "parser.py", line 107, in run
    return method()
  File "parser.py", line 359, in launch_codepath
    self.log_vocab(self._chosen_item())
  File "parser.py", line 263, in _chosen_item
    for item in parsing_data
TypeError: 'NoneType' object is not iterable
Link to comment
  • 4 years later...
  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...