Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eddieantonio/fsttest
Test your Foma FSTs!
https://github.com/eddieantonio/fsttest
finite-state-transducer foma foma-fsts fst fsts testing unit-testing
Last synced: 25 days ago
JSON representation
Test your Foma FSTs!
- Host: GitHub
- URL: https://github.com/eddieantonio/fsttest
- Owner: eddieantonio
- License: mit
- Created: 2020-01-13T17:30:17.000Z (almost 5 years ago)
- Default Branch: development
- Last Pushed: 2021-04-16T20:35:41.000Z (over 3 years ago)
- Last Synced: 2024-10-07T08:15:16.085Z (about 1 month ago)
- Topics: finite-state-transducer, foma, foma-fsts, fst, fsts, testing, unit-testing
- Language: Python
- Homepage:
- Size: 174 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
fsttest
=======[![Build Status](https://travis-ci.org/eddieantonio/fsttest.svg?branch=development)](https://travis-ci.org/eddieantonio/fsttest)
[![codecov](https://codecov.io/gh/eddieantonio/fsttest/branch/development/graph/badge.svg)](https://codecov.io/gh/eddieantonio/fsttest)Test your Foma FSTs!
Install
-------For macOS users with [Homebrew](https://brew.sh/):
$ brew install eddieantonio/eddieantonio/fsttest
For everybody else:
$ pip install fsttest
Usage
-----Write `test_*.toml` scripts in a folder called `tests/`, then run:
$ fsttest
Documentation
-------------* [How to specify the FST under test](https://github.com/eddieantonio/fsttest/blob/development/docs/fst-under-test.md#how-to-specify-the-fst-under-test)
Tutorial
--------In your FST project, create a folder called `tests/`:
$ mkdir tests
Within this folder create a file called `test_{something}.toml` where
`{something}` is something specific to your FST. For example,
`test_phonology.toml`:$ touch tests/test_phonology.toml
Use the following template to create your test:
```toml
# tests/test_phonology.toml
[fst]
eval = "rewrite_rules.xfscript"
compose = ["TInsertion", "NiTDeletion", "Cleanup"][[tests]]
upper = "ni t || [n i | k i] "<" _ Vowel ;
define NiTDeletion n i "<" t -> d || _ Vowel ;
define Cleanup %< -> 0 ;
```Yours will be different!
```toml
compose = ["TInsertion", "NiTDeletion"]
```This line says that the **FST under test** is the result of _composing_
the `TInsertion` regex with the `NiTDeletion` regex. That is, the FST
puts its input into `TInsertion` and then passes the result to
`NiTDeletion`. The result of passing it through both FSTs is the result
we want to test.```toml
[[tests]]
```Next we define one or more test cases. Begin every test case with
`[[tests]]`: note the **two square brackets**!```toml
upper = "ni