1

The following two XFST replace rules represent a cyclic feeding interaction, where the final result includes the original form because the first rule feeds into the second and the second feeds into the first. For example, the first rule would (optionally) turn bat into cat, and the second rule would (optionally) turn cat back into bat.

c (<-) b ;
b (<-) c ;

It is, of course, possible to apply the rules to a lexicon and then compare with the original lexicon, but this is very inefficient. I already have a way to detect cyclic feeding interactions of this kind involving two or more rules (by reading the source files with python), but it is not sensitive to conditional replacement, such as c (<-) b || _ x.

Is it possible to detect whether a set of rules is cyclic by using HFST, without having to apply the rules to a lexicon?

unhammer
  • 4,306
  • 2
  • 39
  • 52
reynoldsnlp
  • 1,072
  • 1
  • 18
  • 45
  • 1
    can you compose all the rules together and look for arcs with opposite pairs? e.g. if I do `foma[0]: regex [c (<-) b || _ x ] .o. [b (<-) c || _ x];` (giving `464 bytes. 2 states, 7 arcs, Cyclic.`) and `foma[1]: view net` I see an arc labeled ` ` – unhammer Oct 14 '21 at 13:20
  • @unhammer I had tried doing a similar thing with `hfst-fst2txt`, but didn't see anything potentially useful. I'm trying now with `foma` (which I've never used directly before), and when I enter `view net` it tells me `Unable to find application named 'Graphviz'`. I have `dot` and it's in my `PATH`. Do you know how I can get `foma` to see it? – reynoldsnlp Oct 14 '21 at 15:24
  • 1
    For anyone else visiting, cf http://tinodidriksen.com/pisg/OFTC/logs/%23hfst/2021-10-14.log foma tries to `open -a Graphviz` on Mac, so for now [Graphviz](https://www.graphviz.org/download/) has to be installed on Mac – unhammer Oct 15 '21 at 11:35
  • 1
    I got `graphviz-gui` to install on MacPorts, but for future reference, I just noticed that foma has `print dot (>filename.dot)` which can then manually be rendered using the usual `dot -Tpng filename.dot > filename.png`. – reynoldsnlp Oct 19 '21 at 20:27
  • 1
    One problem that a composition approach does not resolve is that composition is not commutative, so you would possibly still have to compose the rules in all possible orders. – reynoldsnlp Jan 12 '22 at 20:29

0 Answers0