Commit Graph

3701 Commits

Author SHA1 Message Date
hallgren
cbe5e8ab18 Convert from Text.PrettyPrint to GF.Text.Pretty
All compiler modules now use GF.Text.Pretty instead of Text.PrettyPrint
2014-07-28 11:58:00 +00:00
hallgren
1374c311d7 Adding GF.Infra.Location and GF.Text.Pretty (forgot to 'darcs add' them before) 2014-07-27 22:13:13 +00:00
hallgren
f27d509075 Introducing GF.Text.Pretty for more concise pretty printers and GF.Infra.Location for modularity
GF.Text.Pretty provides the class Pretty and overloaded versions of the pretty
printing combinators in Text.PrettyPrint, allowing pretty printable values to
be used directly instead of first having to convert them to Doc with functions
like text, int, char and ppIdent. Some modules have been converted to use
GF.Text.Pretty, but not all. Precedences could be added to simplify the pretty
printers for terms and patterns.

GF.Infra.Location contains the types Location and L, factored out from
GF.Grammar.Grammar, and the class HasSourcePath. This allowed the import
of GF.Grammar.Grammar to be removed from GF.Infra.CheckM, making it more
like a pure library module.
2014-07-27 22:06:23 +00:00
hallgren
ea6aa6dc02 PGF service: expire PGFs from the cache when they have been unused for 24 hours
...to keep memory use down on the server.
2014-07-21 15:53:38 +00:00
hallgren
47e185679f src/server/gf-server.cabal: update dependencies 2014-07-15 12:00:51 +00:00
john.j.camilleri
d59749c914 PGF Web Service: include entire completion in full mode
When using full=yes in the web service 'complete' command,
you now get an additional field 'seq' with the longest possible completion.
So, given:

  lin
    f1 = ss "the" ;
    f2 = ss ("the red house" | "the real deal") ;

and trying to complete on input "th", you get:

    [
        {
            "from": "TestCnc",
            "brackets": {
                "cat": "_",
                "fid": 0,
                "index": 0,
                "fun": "_",
                "children": []
            },
            "text": "th",
            "completions": [
                {
                    "token": "the",
                    "funs": [
                        {
                            "fun": "f1",
                            "hyps": [],
                            "cat": "C",
                            "seq": "the"
                        },
                        {
                            "fun": "f2",
                            "hyps": [],
                            "cat": "C",
                            "seq": "the red house"
                        },
                        {
                            "fun": "f2",
                            "hyps": [],
                            "cat": "C",
                            "seq": "the real deal"
                        }
                    ]
                }
            ]
        }
    ]
2014-07-15 09:33:22 +00:00
john
747287055f PGF web service: Return additional completion info with 'full' flag
BETA! The 'complete' command now has a new flag 'full' which when set
returns additional info about completions.

Without 'full' flag (default):

[
    {
        "from": "PhrasebookEng",
        "brackets": {
            "cat": "_",
            "fid": 0,
            "index": 0,
            "fun": "_",
            "children": [
                {
                    "token": "the"
                }
            ]
        },
        "text": "su",
        "completions": [
            "supermarket",
            "suspect"
        ]
    }
]

With full=true or full=yes:

[
    {
        "from": "PhrasebookEng",
        "brackets": {
            "cat": "_",
            "fid": 0,
            "index": 0,
            "fun": "_",
            "children": [
                {
                    "token": "the"
                }
            ]
        },
        "text": "su",
        "completions": [
            {
                "token": "supermarket",
                "funs": [
                    {
                        "fid": 421,
                        "fun": "Supermarket",
                        "hyps": [],
                        "cat": "PlaceKind"
                    }
                ]
            },
            {
                "token": "suspect",
                "funs": [
                    {
                        "fid": 445,
                        "fun": "Suspect",
                        "hyps": [],
                        "cat": "Property"
                    }
                ]
            }
        ]
    }
]
2014-07-11 09:25:26 +00:00
kr.angelov
0138869499 implemented computing with abstract syntax trees. It passes all test cases except those that require def rules. The design is consistent with the STG virtual machine 2014-07-08 19:45:49 +00:00
kr.angelov
b3397f8071 bugfix for the typechecker in the C runtime 2014-07-08 19:19:48 +00:00
kr.angelov
153479e991 an API for visitor patterns on abstract syntax trees from Python. This makes the embedded grammars especially pleasing 2014-07-06 23:48:51 +00:00
kr.angelov
a794ec5c42 small fix for the embedded mode in Python 2014-07-06 19:55:08 +00:00
kr.angelov
7afbff6fa8 embedded mode for GF grammar in Python. Only generation for now 2014-07-06 19:49:17 +00:00
kr.angelov
40bfaff8ce filter out the leading +/* from the parser tree 2014-07-03 18:27:39 +00:00
kr.angelov
dde3e1ee73 bugfix in the ParseTreeView 2014-07-03 18:09:34 +00:00
kr.angelov
71b82c88a3 scroll bars for the ParseTreeView 2014-07-03 13:42:26 +00:00
kr.angelov
ba1e95dacb Visualization for parse trees on Android 2014-07-02 11:30:06 +00:00
kr.angelov
42dea944d9 added bracketedLinearize in the Java binding 2014-07-02 07:08:01 +00:00
kr.angelov
410b7c78ce fixed rare memory leak in the Java bindings 2014-07-02 07:06:51 +00:00
kr.angelov
b9ffc8ac00 a few changes in the Nerc that I have forgoten to push 2014-07-01 17:32:25 +00:00
kr.angelov
3843f5505e fix warnings in the compilation of the Java binding 2014-07-01 17:31:29 +00:00
hallgren
93ba5b7b37 minibar: include the grammar's last modification in the grammar info shown by the "i" button
Also bumped version number in gf.cabal to 3.6-darcs.
Also removed some unecessary use of CPP.
2014-06-24 13:59:09 +00:00
hallgren
7f1521dbc5 Polished and renamed release notes to release-3.6.t2t
Also added an example use of lookupmorpho to gf-web-api-examples.html.
2014-06-21 13:02:10 +00:00
hallgren
54d081a036 The --output-dir option now applies also to PGF files 2014-06-21 12:26:56 +00:00
hallgren
eee9617036 Cloud service & apps: better error handling in wide coverage translation
The wide coverage demo apps now shows a "please wait" message while the grammar
is loading, and a red error message if the grammar is not found on the server.
The Simple Translation Tool also show red error messages if the grammar is not
found.
2014-06-20 18:39:28 +00:00
hallgren
78ccefc4f4 PGF Service: return error code 404 (not found) instead of 500 (internal server error) for missing grammars 2014-06-20 17:28:02 +00:00
hallgren
fae535b4e8 PGF Service, command=grammar: include the last modified time of the grammar in the output 2014-06-20 10:34:51 +00:00
aarne
0f1aa6e669 added a note that the green translation comes from the phrasebook 2014-06-20 07:12:31 +00:00
aarne
49b4eac8ad language status in app help file as table ; less text 2014-06-19 17:42:03 +00:00
hallgren
158519624e runtime/c/setup.sh: use make -j to speed up compilation
The configuration script takes significantly longer to run than the compilation
of all the C code, which is a hint that is in need of a major simplification.
2014-06-19 09:26:44 +00:00
hallgren
7b1ad9de51 build-binary-dist.sh: updated to include the Python binding to the C run-time
There are also some changes in src/runtime/python/setyp.py to support this.
2014-06-18 16:09:46 +00:00
kr.angelov
c9dc7db3dd a small change in the keyboard layout for Android to make it more user friendly 2014-06-18 09:51:44 +00:00
kr.angelov
447faf108e filter out identical duplicated translations from the Android UI 2014-06-18 09:17:33 +00:00
hallgren
bfac5faac1 Compute/ConcreteNew.hs: eliminate selections from wildcard tables
This patch also includes some commented out code that was used to search for
the source of code size explosions and an eta expansion bug.
2014-06-17 14:47:55 +00:00
hallgren
f2d60380c6 gf-cloud-api.html: fix a broken link
Thanks to Dana Dannells.
2014-06-17 08:45:13 +00:00
kr.angelov
7d713d1687 now the named entities recognizer returns dictionary entries if the name is known 2014-06-17 06:57:12 +00:00
hallgren
bbeca32a43 src/runtime/c/setup.sh: executable version of INSTALL, used from debian/rules 2014-06-16 23:28:12 +00:00
kr.angelov
21e855c91d fixed memory leak in the Haskell binding to the C runtime 2014-06-16 08:49:13 +00:00
hallgren
f739841497 PGF library: expose only PGF and PGF.Internal instead of all modules
PGF exports the public, stable API.
PGF.Internal exports additional things needed in the GF compiler & shell,
including the nonstardard version of Data.Binary.
2014-06-12 14:43:18 +00:00
kr.angelov
b349e54917 swith off the debugging in the android ui 2014-06-12 09:37:40 +00:00
kr.angelov
18e8502009 now GF keywords can be used as identifiers if they are quoted 2014-06-12 09:36:32 +00:00
hallgren
bc0249b501 PGF2.hsc: use throwIO instead of throw
From the documentation: the throwIO variant should be used in preference to
throw to raise an exception within the IO monad because it guarantees ordering
with respect to other IO operations, whereas throw does not.

Also removed some unused imports.
2014-06-10 12:42:01 +00:00
kr.angelov
7f88320782 now we compile context-free grammars directly to PGF without going via GF source code. This makes it quick and lightweight to compile big grammars such as the Berkley grammar 2014-05-24 07:47:06 +00:00
kr.angelov
78d8524138 bugfix in the Java binding. it was causing a crash in the Android app 2014-05-23 10:52:00 +00:00
kr.angelov
2c04554be5 small fix in tabularLinearize 2014-05-22 13:33:18 +00:00
kr.angelov
c2aad9e313 added tabularLinearize in the python binding 2014-05-22 13:30:14 +00:00
kr.angelov
2dfc6db44e bugfix: the keyboard should not show completions when entering web passwords 2014-05-22 07:25:33 +00:00
kr.angelov
2528952d42 the dictionary view in the app now filters out duplicated morphological analyses 2014-05-22 07:10:28 +00:00
kr.angelov
cf7c3785ef in verbosity mode the compiler warns about missing paths 2014-05-21 07:33:35 +00:00
hallgren
861a3fa805 Compute/ConcreteNew.hs: adding a Prawitz rewrite
(table { p_i => t_i } ! x).l ==> table { p_i => t_i.l } ! x

This was used in the old partial evaluator and can significantly reduce term
sizes in some cases.
2014-05-16 21:27:20 +00:00
hallgren
f78570dabd Fix an eta expansion bug in the grammar compiler
Eta expansion is applied between partial evaluation and PMCFG generation.
The buggy version generated type incorrect terms, but PMCFG generation
apparently worked anyway.
2014-05-16 14:10:07 +00:00