Skip to content

Commit

Permalink
Merge pull request #3 from goavki/conditionals
Browse files Browse the repository at this point in the history
Support --no-pgen, --no-rlx, and --no-prob
  • Loading branch information
sushain97 committed Jan 12, 2015
2 parents ad44545 + dc61676 commit 9a77dcc
Show file tree
Hide file tree
Showing 24 changed files with 254 additions and 1,247 deletions.
75 changes: 54 additions & 21 deletions apertium-init.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,32 @@ PREFIX2=$(LANG2)-$(LANG1)
BASENAME=apertium-$(PREFIX1)

TARGETS_COMMON = \
$(PREFIX1).automorf.bin \
$(PREFIX1).automorf.bin \ {{if_prob1
$(PREFIX1).prob \
$(PREFIX1).rlx.bin \
if_prob1}}{{if_rlx1
$(PREFIX1).rlx.bin \
if_rlx1}}
$(PREFIX1).autobil.bin \
$(PREFIX1).autolex.bin \
$(PREFIX1).autogen.bin \ {{if_pgen2
$(PREFIX1).autopgen.bin \
if_pgen2}}
$(PREFIX1).t1x.bin \
$(PREFIX1).t2x.bin \
$(PREFIX1).t3x.bin \
$(PREFIX1).autogen.bin \
$(PREFIX1).autopgen.bin \
$(PREFIX2).automorf.bin \
$(PREFIX2).automorf.bin \ {{if_prob2
$(PREFIX2).prob \
$(PREFIX2).rlx.bin \
if_prob2}}{{if_rlx2
$(PREFIX2).rlx.bin \
if_rlx2}}
$(PREFIX2).autobil.bin \
$(PREFIX2).autolex.bin \
$(PREFIX2).t1x.bin \
$(PREFIX2).autogen.bin \ {{if_pgen1
$(PREFIX2).autopgen.bin \
if_pgen1}}
$(PREFIX2).t1x.bin \
$(PREFIX2).t2x.bin \
$(PREFIX2).t3x.bin \
$(PREFIX2).autogen.bin \
$(PREFIX2).autopgen.bin
$(PREFIX2).t3x.bin


# This include defines goals for install-modes, .deps/.d and .mode files:
Expand All @@ -43,6 +49,7 @@ TARGETS_COMMON = \
# -------------------
# {{languageName1}} analysis:
# -------------------
{{if_hfst1
.deps/$(PREFIX1).autobil.prefixes: $(PREFIX1).autobil.bin .deps/.d
lt-print $(PREFIX1).autobil.bin | sed 's/ /@_SPACE_@/g' > .deps/$(PREFIX1).autobil.att
hfst-txt2fst -e ε < .deps/$(PREFIX1).autobil.att > .deps/$(PREFIX1).autobil.hfst
Expand All @@ -55,20 +62,26 @@ $(PREFIX1).automorf.bin: $(AP_SRC1)/$(LANG1).automorf.att.gz .deps/$(PREFIX1).au
hfst-compose-intersect -1 .deps/$(LANG1).automorf.hfst -2 .deps/$(PREFIX1).autobil.prefixes -o .deps/$(PREFIX1).automorf.trimmed
hfst-fst2txt -i .deps/$(PREFIX1).automorf.trimmed -o .deps/$(PREFIX1).automorf.trimmed.att
lt-comp lr .deps/$(PREFIX1).automorf.trimmed.att $@
if_hfst1}}{{if_lttoolbox1
$(PREFIX1).automorf.bin: $(AP_SRC1)/$(LANG1).automorf.bin $(PREFIX1).autobil.bin
lt-trim $^ $@
if_lttoolbox1}}

# -------------------
# {{languageName1}} generation:
# ---------------------
{{if_hfst1
$(PREFIX2).autogen.hfst: $(AP_SRC1)/$(LANG1).autogen.hfst
cp $< $@
if_hfst1}}

$(PREFIX2).autogen.bin: $(AP_SRC1)/$(LANG1).autogen.bin
cp $< $@


# -------------------
# {{languageName2}} analysis:
# -------------------
{{if_hfst2
.deps/$(PREFIX2).autobil.prefixes: $(PREFIX2).autobil.bin .deps/.d
lt-print $(PREFIX2).autobil.bin | sed 's/ /@_SPACE_@/g' > .deps/$(PREFIX2).autobil.att
hfst-txt2fst -e ε < .deps/$(PREFIX2).autobil.att > .deps/$(PREFIX2).autobil.hfst
Expand All @@ -81,12 +94,18 @@ $(PREFIX2).automorf.bin: $(AP_SRC2)/$(LANG2).automorf.att.gz .deps/$(PREFIX2).au
hfst-compose-intersect -1 .deps/$(LANG2).automorf.hfst -2 .deps/$(PREFIX2).autobil.prefixes -o .deps/$(PREFIX2).automorf.trimmed
hfst-fst2txt -i .deps/$(PREFIX2).automorf.trimmed -o .deps/$(PREFIX2).automorf.trimmed.att
lt-comp lr .deps/$(PREFIX2).automorf.trimmed.att $@
if_hfst2}}{{if_lttoolbox2
$(PREFIX2).automorf.bin: $(AP_SRC2)/$(LANG2).automorf.bin $(PREFIX2).autobil.bin
lt-trim $^ $@
if_lttoolbox2}}

# -------------------
# {{languageName2}} generation:
# ---------------------
{{if_hfst2
$(PREFIX1).autogen.hfst: $(AP_SRC2)/$(LANG2).autogen.hfst
cp $< $@
if_hfst2}}

$(PREFIX1).autogen.bin: $(AP_SRC2)/$(LANG2).autogen.bin
cp $< $@
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ You will need the following software installed:
* lttoolbox (>= 3.3.0)
* apertium (>= 3.3.0)
* vislcg3 (>= 0.9.9.10297)
{{if_hfst
* hfst (>= 3.8.2)
if_hfst}}

If this does not make any sense, we recommend you look at: www.apertium.org

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ AC_PROG_AWK
m4_define([required_apertium_version], [3.3.0])
PKG_CHECK_MODULES(APERTIUM, apertium >= required_apertium_version, [], [PKG_CHECK_MODULES(APERTIUM, apertium-3.2 >= required_apertium_version)])

{{if_hfst
AC_PATH_PROG(HFSTLEXC, hfst-lexc, no)
if test x$ac_cv_path_HFSTLEXC = x
then
Expand All @@ -27,6 +28,7 @@ if test x$ac_cv_path_HFSTTWOLC = xno
then
AC_MSG_ERROR([You don't have hfst-twolc installed.])
fi
if_hfst}}

AC_PATH_PROG(CGCOMP, cg-comp, no)
if test x$ac_cv_path_CGCOMP = x
Expand Down
88 changes: 0 additions & 88 deletions bilingual-module/hfst-bilingual-module/README

This file was deleted.

94 changes: 0 additions & 94 deletions bilingual-module/hfst-bilingual-module/configure.ac

This file was deleted.

Loading

0 comments on commit 9a77dcc

Please sign in to comment.