Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,19 @@ python/eflomal/bin
# Debug files
*.dSYM/
*.su

# ctags
tags
*.TAG

# Generated
python/eflomal/eflomal.c

# Virtualenv and build
pyvenv.cfg
bin
build
lib
lib64
**/*.egg-info
**/__pycache__
1 change: 1 addition & 0 deletions devscripts/ctags.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ctags [email protected] -R python/ src/
8 changes: 8 additions & 0 deletions devscripts/curl_server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/env sh

echo "Run eflomal-server in this directory, so it picks up server_config.json, then perform the sample request:"

curl -X POST $@ localhost:5000/api/align/v1 -H 'Content-type: application/json' -H 'Accept: application/json' -d '{"aligner": "my-align", "samplers": 3, "iters": {"1":64, "2": 32, "3": 8}, "trust_sents": false, "sents":[{"s":"The cow and grass", "t":"Die Kuh und das Gras"}]}'

# Approximate response:
# {"aligns":[{"fwd":"0-0 0-1 1-2 2-3 3-4","norm_score_fwd":3.954102087565899,"norm_score_rev":2.250345638880109,"rev":"0-0 1-1 2-3 3-4","score_fwd":5.56354,"score_rev":3.63664}]}
8 changes: 8 additions & 0 deletions devscripts/server_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"aligners": [
{ "name": "my-align",
"priors": "testdata/my-align.pri"
}
],
"log_level": "debug"
}
3 changes: 3 additions & 0 deletions devscripts/testdata/create-prior.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/env sh
eflomal-align -i my-align.txt -f my-align.fwd -r my-align.rev
eflomal-makepriors -i my-align.txt -f my-align.fwd -r my-align.rev -p my-align.pri
6 changes: 6 additions & 0 deletions devscripts/testdata/my-align.fwd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
1-0 2-2 3-3
0-0 1-1 2-2 4-3 6-4
1-0 2-2 3-3
0-0 2-1 4-2
0-0 2-1 3-2 4-3
1-0 2-2 3-3 4-4 5-5 6-6
56 changes: 56 additions & 0 deletions devscripts/testdata/my-align.pri
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
LEX Auf There 1
LEX Die cow 3
LEX Freunde friends 1
LEX Gras grass 1
LEX Häschen rabbit 2
LEX Lass Let 2
LEX Wiese a 1
LEX das the 2
LEX der is 1
LEX die cow 1
LEX eine grass 1
LEX frisst eats 1
LEX ist is 1
LEX mich see 2
LEX schläfrig sleepy 1
LEX sind are 1
LEX steht on 1
LEX und and 1
FERF Let 1 2
FERF There 1 1
FERF a 1 1
FERF and 1 1
FERF are 1 1
FERF cow 1 4
FERF eats 1 1
FERF friends 1 1
FERF grass 1 2
FERF is 1 2
FERF on 1 1
FERF rabbit 1 2
FERF see 1 2
FERF sleepy 1 1
FERF the 1 2
FERR Auf 1 1
FERR Die 1 3
FERR Freunde 1 1
FERR Gras 1 1
FERR Häschen 1 2
FERR Kuh 1 5
FERR Lass 1 2
FERR Wiese 1 1
FERR das 1 2
FERR der 1 1
FERR die 1 1
FERR eine 1 1
FERR frisst 1 1
FERR ist 1 1
FERR mich 1 2
FERR schläfrig 1 1
FERR sind 1 1
FERR steht 1 1
FERR und 1 1
HMMF 1 22
HMMF 2 8
HMMR 1 33
HMMR 2 2
6 changes: 6 additions & 0 deletions devscripts/testdata/my-align.rev
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0-0 1-1 2-2 3-3
0-0 1-1 2-2 3-3 4-4 5-5
0-0 1-1 2-2 3-3
0-0 1-1 3-2 4-3
0-0 1-1 3-2 4-3
0-0 1-1 2-2 3-3 4-4 5-5 6-6
6 changes: 6 additions & 0 deletions devscripts/testdata/my-align.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The cow eats grass ||| Die Kuh frisst Gras
There is a cow on the grass ||| Auf der Wiese steht eine Kuh
The cow is sleepy ||| Die Kuh ist schläfrig
Let me see the cow ||| Lass mich die Kuh sehen
Let me see the rabbit ||| Lass mich das Häschen sehen
The cow and the rabbit are friends ||| Die Kuh und das Häschen sind Freunde
Loading