Difference between revisions of "Apertium-init"

From LING073
Jump to: navigation, search
(Create a language module: .py not needed with actual installer :))
(Create a language module)
Line 7: Line 7:
 
== Create a language module ==
 
== Create a language module ==
 
Create an hfst-based apertium language module (in your Source directory), replacing <code>xyz</code> with the ISO code of your language in all occurrences:
 
Create an hfst-based apertium language module (in your Source directory), replacing <code>xyz</code> with the ISO code of your language in all occurrences:
* <code>apertium-init -a hfst xyz; mv apertium-xyz ling073-xyz</code>
+
* <code>apertium-init -a hfst xyz</code>
 +
Rename the module <code>ling073-xyz</code> if you want (so that it matches what will be in github later, and any further instructions):
 +
* <code>mv apertium-xyz ling073-xyz</code>
  
 
Notes:
 
Notes:

Revision as of 16:41, 7 February 2017

You can the apertium-init or bootstrapping tool to create a directory for quick development of a transducer.

Install apertium-init

Download apertium-init and put it somewhere usable:

Create a language module

Create an hfst-based apertium language module (in your Source directory), replacing xyz with the ISO code of your language in all occurrences:

  • apertium-init -a hfst xyz

Rename the module ling073-xyz if you want (so that it matches what will be in github later, and any further instructions):

  • mv apertium-xyz ling073-xyz

Notes:

  • You will probably get an error about SVN and the directory not being a working copy—you can safely ignore this.
  • If something goes wrong (e.g., you make a typo), delete any directories/files that were created and try the step again.

Commit to github

If this is a language pair you would like to commit to github, do the following before modifying any files or compiling the module:

  1. Create an empty (no files) repository named ling073-xyz on github.
  2. Initialise your new ling073-xyz directory as a github repository, and commit all the files:
    • cd ling073-xyz; git init ./ ; git add * ; git commit -m "initialising directory with bootstrapped module"
  3. Set the github repository you created as the remote origin, replacing "username" and "xyz" below as appropriate:
    • git remote add origin git@github.swarthmore.edu:username/ling073-xyz.git
  4. Push the bootstrapped module to origin:
    • git push --set-upstream origin master
  5. After this you should be able to see the same files from the github web interface and in the directory. You should also be able to commit, push, pull, etc. all normally.