Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Digital Linguistics profile imageDaniel W. Hieber
Daniel W. Hieber forDigital Linguistics

Posted on

     

Installing Finite-State Transducer (FST) tools on Windows

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 andhfst—on Windows. (If you're on Mac or Linux, those links also have installation instructions for those platforms.)


  1. Download foma by going to thefoma home page >Precompiled binaries for Win32, OSX, Linux >foma-X.X.X_win32.zip (where the X's are the latest version numbers).

  2. Download hfst by going to thehfst home page >download page >win32 executables >hfst-latest.zip.

  3. Extract the zip file for both downloads.

  4. Rename the folder in the foma download fromwin32 tofoma.

  5. Move both extracted folders toC:\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 withfoma orhfst. At the moment, however, if you open a command line, nofoma orhfst commands are available. So let's fix that:

  1. 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.)

  2. ASystem Properties dialog box will open. ClickEnvironment Variables in the lower right.

  3. AnEnvironment Variables dialog box will open. UnderUser variables for {username}, click onPath and then clickEdit.

  4. You will now add the paths to the foma and hfst executables that you placed in Program Files earlier. Do this by clickingNew 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 thefoma andhfst commands and be able to run them. Let's check:

  1. Open a terminal / command line, typefoma -h and press Enter. You should see the following:

Help text returned by the foma command

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 thefoma command.

  1. Check for thehfst 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!

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Trending onDEV CommunityHot

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp