summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjordi.saludes <jordi.saludes@upc.edu>2011-12-22 21:29:45 +0000
committerjordi.saludes <jordi.saludes@upc.edu>2011-12-22 21:29:45 +0000
commitfb0f46be4a0cc4d673c9bd1153c0cb8c674ad9d5 (patch)
tree695562f3363e88a294efbaf6e1947cddc25f1302
parentbff947f44f70e3c3f5f4d25ed07524730ca56acf (diff)
Fixing 'linearize' in py-bindings/test.py
-rw-r--r--contrib/py-bindings/PyGF.hsc5
-rw-r--r--contrib/py-bindings/example.rst4
-rw-r--r--contrib/py-bindings/gfmodule.c2
-rw-r--r--contrib/py-bindings/test.py4
4 files changed, 6 insertions, 9 deletions
diff --git a/contrib/py-bindings/PyGF.hsc b/contrib/py-bindings/PyGF.hsc
index ddd3920b6..fc827e68f 100644
--- a/contrib/py-bindings/PyGF.hsc
+++ b/contrib/py-bindings/PyGF.hsc
@@ -1,7 +1,7 @@
{-# LANGUAGE ForeignFunctionInterface #-}
--
-- GF Python bindings
--- Jordi Saludes, upc.edu 2010
+-- Jordi Saludes, upc.edu 2010, 2011
--
module PyGF where
@@ -157,9 +157,6 @@ listToPyStrings ss = do
pcs <- pyString cs
pyl << pcs
-
--- foreign export ccall "gf_freeArray" free :: Ptr a -> IO ()
-
foreign export ccall gf_showLanguage :: Ptr Language -> IO CString
gf_showLanguage plang = do
diff --git a/contrib/py-bindings/example.rst b/contrib/py-bindings/example.rst
index 4d3c015c0..770c6e862 100644
--- a/contrib/py-bindings/example.rst
+++ b/contrib/py-bindings/example.rst
@@ -9,7 +9,7 @@ First you must import the library:
>>> import gf
-then load a .pgf file, like this tiny example:
+then load a PGF file, like this tiny example:
>>> pgf = gf.read_pgf("Query.pgf")
@@ -73,7 +73,7 @@ Is it important to note the blank space at the end, otherwise we get it again:
['is']
But, how come that nothing is suggested at "is "?
-At the current point, a literal integer is expected so GF would have to present an infinite list of alternatives. I can not blame it for refusing to do so.
+At the current point, a literal integer is expected so GF would have to present an infinite list of alternatives. I cannot blame it for refusing to do so.
>>> pgf.complete(eng, "is 42 ")
['even', 'odd', 'prime']
diff --git a/contrib/py-bindings/gfmodule.c b/contrib/py-bindings/gfmodule.c
index 931baf072..99824fb77 100644
--- a/contrib/py-bindings/gfmodule.c
+++ b/contrib/py-bindings/gfmodule.c
@@ -267,7 +267,7 @@ static PyMethodDef expr_methods[] = {
-/* tree typr: methods, constructor and destructor */
+/* tree type: methods, constructor and destructor */
// Are Expr and Tree equivalent ?
REPRCB(tree_repr, Tree, gf_showExpr)
diff --git a/contrib/py-bindings/test.py b/contrib/py-bindings/test.py
index 6ec3f77cc..9ea6c1f45 100644
--- a/contrib/py-bindings/test.py
+++ b/contrib/py-bindings/test.py
@@ -108,7 +108,7 @@ class TestLinearize(unittest.TestCase):
l = self.lang
for abs,cnc in self.samples:
ts = self.pgf.parse(l, cnc['eng'])
- self.assertEqual(cnc['eng'],self.pgf.lin(l,ts[0]))
+ self.assertEqual(cnc['eng'],self.pgf.linearize(l,ts[0]))
class TestTranslate(unittest.TestCase):
def setUp(self):
@@ -123,7 +123,7 @@ class TestTranslate(unittest.TestCase):
if i==j: continue
parsed = self.pgf.parse(l, cnc[i])
assert len(parsed) == 1
- lin = self.pgf.lin(m,parsed[0])
+ lin = self.pgf.linearize(m,parsed[0])
self.assertEqual(lin,cnc[j])
class TestUnapplyExpr(unittest.TestCase):