https://github.com/dativebase/old-parser-research
Scripts for doing morphological parser-based research via an OLD web service
https://github.com/dativebase/old-parser-research
Last synced: 10 months ago
JSON representation
Scripts for doing morphological parser-based research via an OLD web service
- Host: GitHub
- URL: https://github.com/dativebase/old-parser-research
- Owner: dativebase
- Created: 2014-03-27T23:55:54.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-07-28T14:52:04.000Z (almost 12 years ago)
- Last Synced: 2024-04-14T23:58:11.484Z (about 2 years ago)
- Language: Python
- Size: 285 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
OLD Parser Research
===================
The OLD Parser Research library contains utilities and examples to help
with performing research involving the morphological parser
functionality of a live OLD application.
Using `oldclient.py`
--------------------
Probably the most useful general-purpose script is `oldclient.py` which
is a thin OLD-specific wrapper around the Python Requests library. This
module facilitates HTTP-based interaction with a live OLD web service.
Assuming that you have an OLD web service
() being served at 127.0.0.1 on port
5000, an example of usage of `oldclient.py` is as follows:
>>> import oldclient
>>> old = oldclient.OLDClient('127.0.0.1', '5000')
>>> old.login('yourusername', 'yourpassword') # True
>>> forms = old.get('forms') # `forms` is a list of dicts
>>> forms[0]['transcription'] # u'transcription value'
Example foma phonology scripts in resources/
--------------------------------------------
The `resources/` directory contains example phonology scripts written in
the regular expression rewrite rule formalism accepted by FST programs
like foma and XFST. Example usage is as follows:
$ foma
foma[0]: source resources/blackfoot_phonology_frantz91.script
foma[0]: regex phonology ;
foma[1]: down nit-ihpiyi # Returns nitsspiyi and nitsiihpiyi
See the foma page () for more details.
Other potentially useful files
------------------------------
### researcher.py
Module that defines the `ParserResearcher` class which represents an OLD
researcher which creates form searches, corpora, phonologies,
morphologies, LMs, and parsers, and which provides conveniences for
storing representations of these locally and for parsing and testing
parsers.
### blackfoot\_research.py
Executable that exemplifies using the functionality in `researcher.py`
(and in `oldclient.py`) in order to perform parser-based research on a
specific language via an OLD web service. While language-specific and
rife with ad hoc code, it may be useful as an example.