summaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/haskell/PGF.hs2
-rw-r--r--src/runtime/haskell/PGF/Linearize.hs7
-rw-r--r--src/runtime/java/INSTALL3
-rw-r--r--src/runtime/java/Makefile7
-rw-r--r--src/runtime/python/examples/README2
5 files changed, 18 insertions, 3 deletions
diff --git a/src/runtime/haskell/PGF.hs b/src/runtime/haskell/PGF.hs
index 6c0002a8a..134a13c3b 100644
--- a/src/runtime/haskell/PGF.hs
+++ b/src/runtime/haskell/PGF.hs
@@ -58,7 +58,7 @@ module PGF(
-- * Operations
-- ** Linearization
- linearize, linearizeAllLang, linearizeAll, bracketedLinearize, tabularLinearizes,
+ linearize, linearizeAllLang, linearizeAll, bracketedLinearize, bracketedLinearizeAll, tabularLinearizes,
groupResults, -- lins of trees by language, removing duplicates
showPrintName,
diff --git a/src/runtime/haskell/PGF/Linearize.hs b/src/runtime/haskell/PGF/Linearize.hs
index e3e8d92db..5fdb186c1 100644
--- a/src/runtime/haskell/PGF/Linearize.hs
+++ b/src/runtime/haskell/PGF/Linearize.hs
@@ -4,6 +4,7 @@ module PGF.Linearize
, linearizeAll
, linearizeAllLang
, bracketedLinearize
+ , bracketedLinearizeAll
, tabularLinearizes
) where
@@ -47,6 +48,12 @@ bracketedLinearize pgf lang = head . map (snd . untokn Nothing . firstLin cnc) .
head [] = []
head (bs:bss) = bs
+-- | Linearizes given expression as a bracketed string in the language
+bracketedLinearizeAll :: PGF -> Language -> Tree -> [[BracketedString]]
+bracketedLinearizeAll pgf lang = map (snd . untokn Nothing . firstLin cnc) . linTree pgf cnc
+ where
+ cnc = lookMap (error "no lang") lang (concretes pgf)
+
firstLin cnc arg@(ct@(cat,n_fid),fid,fun,es,(xs,lin)) =
case IntMap.lookup fid (linrefs cnc) of
Just (funid:_) -> snd (mkLinTable cnc (const True) [] funid [arg]) ! 0
diff --git a/src/runtime/java/INSTALL b/src/runtime/java/INSTALL
index c0e91a355..3facef134 100644
--- a/src/runtime/java/INSTALL
+++ b/src/runtime/java/INSTALL
@@ -10,3 +10,6 @@ Once this is done type:
$ make
$ make install
+
+For Windows you might have to uncomment the lines around
+WINDOWS_FLAGS in the Makefile.
diff --git a/src/runtime/java/Makefile b/src/runtime/java/Makefile
index 02083ddac..d5a25a2f6 100644
--- a/src/runtime/java/Makefile
+++ b/src/runtime/java/Makefile
@@ -7,6 +7,11 @@ JNI_INCLUDES = $(if $(wildcard /usr/lib/jvm/default-java/include/.*), -I/usr/lib
$(if $(wildcard /Library/Java/Home/include/.*), -I/Library/Java/Home/include/ -I/Library/Java/Home/include/darwin, \
$(error No JNI headers found))))
+# For Windows replace the previous line with something like this:
+#
+# JNI_INCLUDES = -I "C:/Program Files/Java/jdk1.8.0_171/include" -I "C:/Program Files/Java/jdk1.8.0_171/include/win32" -I "C:/MinGW/msys/1.0/local/include"
+# WINDOWS_FLAGS = -L"C:/MinGW/msys/1.0/local/lib" -no-undefined
+
INSTALL_PATH = /usr/local/lib
LIBTOOL = glibtool --tag=CC
@@ -15,7 +20,7 @@ LIBTOOL = $(if $(shell command -v glibtool 2>/dev/null), glibtool --tag=CC, libt
all: libjpgf.la jpgf.jar
libjpgf.la: $(patsubst %.c, %.lo, $(C_SOURCES))
- $(LIBTOOL) --mode=link gcc $(CFLAGS) -g -O -o libjpgf.la -shared $^ -rpath $(INSTALL_PATH) -lgu -lpgf -lsg
+ $(LIBTOOL) --mode=link gcc $(CFLAGS) -g -O -o libjpgf.la -shared $^ -rpath $(INSTALL_PATH) -lgu -lpgf -lsg $(WINDOWS_FLAGS)
%.lo : %.c
$(LIBTOOL) --mode=compile gcc $(CFLAGS) -g -O -c $(JNI_INCLUDES) -std=c99 -shared $< -o $@
diff --git a/src/runtime/python/examples/README b/src/runtime/python/examples/README
index b6791a368..813c2f9c9 100644
--- a/src/runtime/python/examples/README
+++ b/src/runtime/python/examples/README
@@ -9,7 +9,7 @@ TRANSLATION PIPELINE
The module translation_pipeline.py is a Python replica of the
translation pipeline used in Wide-coverage Translation demo.
The pipeline allows for
- 1. simulataneous batch translation from one language into multiple languages
+ 1. simultaneous batch translation from one language into multiple languages
2. K-best translations
3. translate both text files and sgm files.