Skip to content

Instantly share code, notes, and snippets.

@vznvzn
Created November 10, 2018 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vznvzn/f89fa5b89aa6b5aaa2efa99003f8de40 to your computer and use it in GitHub Desktop.
Save vznvzn/f89fa5b89aa6b5aaa2efa99003f8de40 to your computer and use it in GitHub Desktop.
@echo off
set n=1
set out1="out1.txt"
echo. >NUL 2> %out1%
:re
set /a n2 = n + 1
echo %n% %n2%
set f="fstlen%n%.fst"
set f2="fstlen%n2%.fst"
fstlen %n%
fstlen %n2%
fstcompile --acceptor=true fstlen%n%.txt %f%
fstcompile --acceptor=true fstlen%n2%.txt %f2%
call fstmin %f%
set f3="fstlen%n2%b.fst"
fstdifference %f2% %f% %f3%
call fstmin %f3%
set fn=fsmb.fst
set f4="map.fst"
fstcompose %f3% %fn% | fstproject --project_output=true > %f4%
set f5="mapin.fst"
fstintersect %f3% %f4% > %f5%
fstrmepsilon %f5% | fstshortestpath | fsttopsort | fstprint | s2b >> %out1%
set n=%n2%
if %n% leq 49 goto re
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment