summaryrefslogtreecommitdiff
path: root/src/runtime/haskell/PGF.hs
AgeCommit message (Collapse)Author
2023-03-01export BindType(..)Krasimir Angelov
2018-11-30Fix deprecations from containers >= 0.4.0.0Peter Ljunglöf
E.g. `foldWithKey` has been deprecated since 0.4.0.0 (November 2010)[1] and has been removed in 0.6.0.1 (2018)[2] [1]: https://github.com/haskell/containers/blob/master/changelog.md#0400--nov-2010 [2]: https://github.com/haskell/containers/blob/master/changelog.md#death-of-deprecated-functions (commit originally by @fredefox)
2018-08-06A version of `readPGF` where the user handles the IO.Frederik Hanghøj Iversen
2018-05-24add bracketLinearizeAll for variantsPrasanth Kolachina
2017-09-06A new function called "completions" is added in the Haskell runtime and used ↵Krasimir Angelov
in PGFService. This makes the extraction of completions more platform independent
2017-09-05GF.Command.TreeOperations is now independent from the runtime's internalsKrasimir Angelov
2017-09-05added exprSize and exprFunctions in the Haskell runtime too and use them in ↵Krasimir Angelov
TreeOperations
2017-08-29the embedded grammars now work with both the pure Haskell and the Haskell ↵Krasimir Angelov
binding API
2017-04-06vd command now reads local concrete configurations to deal with syncat ↵aarne
words; TODO: dissolve clustered multiwords bound with +
2016-06-09PGF service & minibar: only show dependency diagrams if the labels are knownhallgren
+ The PGF service now reads and caches dependency label configuration files. + The grammar info returned by command=grammar has a new boolean field 'hasDependencyLabels' to indicate if dependency labels were found for the grammar. Also, command=deptree will now fail if no labels are present. + The minibar only shows word dependency trees if labels are present. + Also changed the type of getDepLabels from [String] -> Labels to String -> Labels, since all uses were in the form "getDepLabels . lines".
2015-11-23vd -conll2latex now converts conll to latex. Without going through GF trees, ↵aarne
but as a service to the dependency parser community.
2015-11-04dependency labels in parse trees now with the -deps flag, -file=labels_file ↵aarne
for configuration. With -nocat option this shows reasonable dep trees, more familiar looking than the vd command. With -showfun flag, the tree gives a rather complete picture of the analysis of the sentence.
2015-04-20drop the dependency to FSTkrasimir
2015-03-24PGF Service: add an option to return syntax trees in JSON formathallgren
The parse/translate/c-parse/c-translate commands now recognize the option jsontree=true to augment the returned JSON structure with a field called "jsontree" next to the field "tree", or "jsontrees" next to "trees", containing the the returned syntax tree in JSON format (the same format returned by the abstrjson command, similar to the format returned in the "brackets" field).
2014-08-11a partial support for def rules in the C runtimekr.angelov
The def rules are now compiled to byte code by the compiler and then to native code by the JIT compiler in the runtime. Not all constructions are implemented yet. The partial implementation is now in the repository but it is not activated by default since this requires changes in the PGF format. I will enable it only after it is complete.
2014-07-11PGF web service: Return additional completion info with 'full' flagjohn
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" } ] } ] } ]
2013-11-26Represent identifiers as UTF-8-encoded ByteStringshallgren
This was a fairly simple change thanks to previous work on making the Ident type abstract and the fact that PGF.CId already uses UTF-8-encoded ByteStrings. One potential pitfall is that Data.ByteString.UTF8 uses the same type for ByteStrings as Data.ByteString. I renamed ident2bs to ident2utf8 and bsCId to utf8CId, to make it clearer that they work with UTF-8-encoded ByteStrings. Since both the compiler input and identifiers are now UTF-8-encoded ByteStrings, the lexer now creates identifiers without copying any characters. **END OF DESCRIPTION*** Place the long patch description above the ***END OF DESCRIPTION*** marker. The first line of this file will be the patch name. This patch contains the following changes: M ./src/compiler/GF/Compile/CheckGrammar.hs -3 +3 M ./src/compiler/GF/Compile/GrammarToPGF.hs -2 +2 M ./src/compiler/GF/Grammar/Binary.hs -5 +1 M ./src/compiler/GF/Grammar/Lexer.x -11 +13 M ./src/compiler/GF/Infra/Ident.hs -19 +36 M ./src/runtime/haskell/PGF.hs -1 +1 M ./src/runtime/haskell/PGF/CId.hs -2 +3
2013-11-06the content of ParseEngAbs3.probs is now merged with ParseEngAbs.probs. The ↵kr.angelov
later is now retrained. Once the grammar is compiled with the .probs file now it doesn't need anything more to do robust parsing. The robustness itself is controlled by the flags 'heuristic_search_factor', 'meta_prob' and 'meta_token_prob' in ParseEngAbs.gf
2013-11-05Eliminate mutual dependencies between the GF compiler and the PGF libraryhallgren
+ References to modules under src/compiler have been eliminated from the PGF library (under src/runtime/haskell). Only two functions had to be moved (from GF.Data.Utilities to PGF.Utilities) to make this possible, other apparent dependencies turned out to be vacuous. + In gf.cabal, the GF executable no longer directly depends on the PGF library source directory, but only on the exposed library modules. This means that there is less duplication in gf.cabal and that the 30 modules in the PGF library will no longer be compiled twice while building GF. To make this possible, additional PGF library modules have been exposed, even though they should probably be considered for internal use only. They could be collected in a PGF.Internal module, or marked as "unstable", to make this explicit. + Also, by using the -fwarn-unused-imports flag, ~220 redundant imports were found and removed, reducing the total number of imports by ~15%.
2013-10-30added the linref construction in GF. The PGF version number is now bumpedkr.angelov
2013-10-24Functions merge trees into tries in the GF Shell and the PGF web servicehallgren
* In the shell, the new command tt (to_trie) merges a list of trees into a trie and prints it in a readable way, where unique subtrees are marked with a "*" and alternative subtrees are marked with numbers. * In the PGF web service, adding the parameter trie=yes to the parse and translate commands augments the JSON output with a trie. Example to try in the shell: Phrasebook> p -lang=Eng "your son waits for you" | tt
2013-04-08PGF.hs: export function missingLinshallgren
Also in Commands.hs: be explicit about things imported from the PGF library that are not in the public API. Also a couple of haddock documentation fixes.
2012-11-22PGFService.hs: fix type error caused by change to PGF.graphvizParseTreehallgren
Note that some of the graphviz functions have backwards incompatible changes that might also affect other clients of the PGF run-time library. Also added graphvizDefaults and export it together with GraphvizOptions from the PGF run-time library.
2012-09-18the Haskell runtime now exports 'functionsByCat' which returns the list of ↵kr.angelov
all functions for a given category
2012-08-29A basic infrastructure for generating Teyjus bytecode from the GF abstract ↵kr.angelov
syntax
2012-03-18PGF run-time library: function names in BracketedString (experimental)hallgren
+ Make room for function names in the BracketedString data structure. + Fill in function names when linearizing an abstract syntax tree to a BracketedString. + Fill in wildCId when it is not obvious what the function is. + Function bracketedLinearize: for compatibility with the other linearization functions, return Leaf "" instead of error "cannot linearize". + Export flattenBracketedString from module PGF. + PGFServce: make function names available in the JSON representation of BracketedString.
2011-10-20PGF.hs: Add LANGUAGE BangPatterns to make GHC 7.2 happyhallgren
Also remove oddly named function forExample (topological sorting) from export list.
2011-09-15added topological sort module to PGF - to be used in example based grammar ↵ra.monique
writing
2011-02-10Adding a basic lexicon-based tokenizer and the asociated command in gf shellgdetrez
2010-12-07moved PGF.ToApi to GF.Compile.ToAPIaarne
2010-12-05added syntax to api translation modulera.monique
2010-10-31added giza Alignments with command ga and merged the rendering algorithm for ↵ramona.enache
graphviz and giza alignments
2010-10-18added explicit depth parameter to the parsing API and the corresponding ↵krasimir
command in the shell
2010-10-02refactor the API for random generation again. Now PGF contains probabilities ↵krasimir
in the abstract syntax
2010-09-22the first revision of exhaustive and random generation with dependent types. ↵krasimir
Still not quite stable.
2010-09-22cleanup and export the Probabilistic API from PGFkrasimir
2010-08-24more advanced complete function in the PGFServicekrasimir
2010-07-31two new functions in the PGF API: mkAbs, unAbskrasimir
2010-07-31now the meta id of the meta variables is accessible via the PGF APIkrasimir
2010-07-31added function unType in PGFkrasimir
2010-07-01redesign the open-literals APIkrasimir
2010-06-29introduce the type synonym Token=String in the PGF APIkrasimir
2010-06-22preliminary version of API for Open Literalskrasimir
2010-05-19now the parser could return partial parse resultskrasimir
2010-04-30for backward compatibility we have the old parse function again. the old ↵krasimir
functionality is exposed by parse_
2010-04-30first incarnation of the bracketed string APIkrasimir
2010-03-31export fullFormLexicon from PGFkrasimir
2010-03-24now for every category we store, in PGF, the list of functions for it in ↵krasimir
source-code order. The order matters for the termination of the exhaustive generation with dependent types.
2010-03-22PGF.groupResults and the option l -groups, to show ambiguities grouped by ↵aarne
laguage
2010-03-18syntax for inaccessible patterns in GFkrasimir