Difference between revisions of "Apertium-init"

From LING073
Jump to: navigation, search
m (Create a language module)
(Commit to github)
Line 16: Line 16:
  
 
== Commit to github ==
 
== 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:
+
If this is a language pair you would like to push to github, do the following ideally before modifying any files or compiling the module:
 
# Create an ''empty'' (no files) repository named <code>ling073-xyz</code> on github.
 
# Create an ''empty'' (no files) repository named <code>ling073-xyz</code> on github.
# Initialise your new <code>ling073-xyz</code> directory as a github repository, and commit all the files:
+
<!-- # Initialise your new <code>ling073-xyz</code> directory as a github repository, and commit all the files:
 
#* <code>cd ling073-xyz; git init ./ ; git add * ; git commit -m "initialising directory with bootstrapped module"</code>
 
#* <code>cd ling073-xyz; git init ./ ; git add * ; git commit -m "initialising directory with bootstrapped module"</code>
# Set the github repository you created as the remote origin, replacing "username" and "xyz" below as appropriate:
+
-->
#* <code>git remote add origin git@github.swarthmore.edu:username/ling073-xyz.git</code>
+
# Make sure the repository really was created correctly by running <code>git log</code>.  You should see a single commit named "initial commit".
 +
# Set the github repository you created as the remote origin:
 +
#* <code>git remote add origin git@github.swarthmore.edu:username/ling073-xyz.git</code> (replacing "username" and "xyz" below as appropriate)
 
# Push the bootstrapped module to origin:
 
# Push the bootstrapped module to origin:
 
#* <code>git push --set-upstream origin master</code>
 
#* <code>git push --set-upstream origin master</code>

Revision as of 01:58, 15 February 2018

You can the apertium-init tool to create ("bootstrap") a directory for quick development of a transducer.

Install apertium-init

Download apertium-init and install it:

Create a language module

Create an hfst-based apertium language module (in your ~/ling073 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:

  • If get an error about SVN and the directory not being a working copy, then you have an old version of apertium-init.
  • 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 push to github, do the following ideally before modifying any files or compiling the module:

  1. Create an empty (no files) repository named ling073-xyz on github.
  2. Make sure the repository really was created correctly by running git log. You should see a single commit named "initial commit".
  3. Set the github repository you created as the remote origin:
    • git remote add origin git@github.swarthmore.edu:username/ling073-xyz.git (replacing "username" and "xyz" below as appropriate)
  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.