This content originally appeared on DEV Community and was authored by Daniel W. Hieber
Finite-state transducers (FSTs) are often used in linguistics to create morphological models of a language, which can both parse words in that language and return a morphological analysis, and accept a morphological analysis and produce a grammatically correct word. While FSTs and computational models sound complex, they're actually fairly straightforward! You don't need to have advanced computational skills. The most difficult part is in fact the grammatical analysis of the language rather than implementing that analysis as an FST. Any linguist can create an FST.
In this post I'll show you how to install the two most common tools for creating FSTs—foma and hfst—on Windows. (If you're on Mac or Linux, those links also have installation instructions for those platforms.)
Download foma by going to the foma home page >
Precompiled binaries for Win32, OSX, Linux
>foma-X.X.X_win32.zip
(where the X's are the latest version numbers).Download hfst by going to the hfst home page >
download page
>win32 executables
>hfst-latest.zip
.Extract the zip file for both downloads.
Rename the folder in the foma download from
win32
tofoma
.Move both extracted folders to
C:\Program Files (x86)
, like so:
C:\Program Files (x86)\foma
C:\Program Files (x86)\hfst
Next you need to make the foma and hfst commands available to run from the terminal / command line. Neither foma nor hfst have a graphical user interface, so you run them by opening a command line (press the Windows key, then type "command", and open the Command Prompt program that is shown) and typing simple text commands that begin with foma
or hfst
. At the moment, however, if you open a command line, no foma
or hfst
commands are available. So let's fix that:
Press the Windows key and type "path". One of the options should be "Edit the system environment variables"—open that. (If that option doesn't appear, search for "path" or "environment variables" in Settings.)
A
System Properties
dialog box will open. ClickEnvironment Variables
in the lower right.An
Environment Variables
dialog box will open. UnderUser variables for {username}
, click onPath
and then clickEdit
.You will now add the paths to the foma and hfst executables that you placed in Program Files earlier. Do this by clicking
New
and adding a line for each. Note that for hfst you also need to add\bin
to the path, like so:
C:\Program Files (x86)\foma
C:\Program Files (x86)\hfst\bin
The command line should now know about the existence of the foma
and hfst
commands and be able to run them. Let's check:
- Open a terminal / command line, type
foma -h
and press Enter. You should see the following:
The -h
flag stands for "help", and displays information about how to use foma. If you got the help text, it worked! The command line successfully recognized the foma
command.
- Check for the
hfst
command in a similar way: typehfst-info
and press enter, and you should get see information about the hfst software.
You're all set! You are now ready to begin creating and using finite-state transducers!
This content originally appeared on DEV Community and was authored by Daniel W. Hieber
Daniel W. Hieber | Sciencx (2021-09-04T04:48:41+00:00) Installing Finite-State Transducer (FST) tools on Windows. Retrieved from https://www.scien.cx/2021/09/04/installing-finite-state-transducer-fst-tools-on-windows/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.