summaryrefslogtreecommitdiff
path: root/src/runtime/haskell/PGF
AgeCommit message (Collapse)Author
2014-06-12PGF library: expose only PGF and PGF.Internal instead of all moduleshallgren
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-04-09Change the type of PGF.Lexing.bindTok to [String] -> [String]hallgren
The old type was [String] -> String. This function was only used in GF.Text.Lexing.stringOp, which now uses (unwords . bindTok) instead, with no change in behaviour.
2014-04-09Unlexers: move capitalization of first word from GF.Text.Lexing to PGF.Lexinghallgren
The capitalization of the first word was done in GF.Text.Lexing.stringOp, but is now done in the functions unlexText and unlexMixed in PGF.Lexing. These functions are only used in stringOp and in PGFService (where the change is needed), so the subtle change in behaviour should not cause any bugs.
2014-04-09PGF Service: a bit more clever lexer=texthallgren
Only change the first word to lowercase if the original input is not found in the grammar's morphology. This allows parsing of sentenses starting with "I" in English, nouns in German and proper names in other languages, but it can make the wrong choice for multi-words.
2014-04-08Move basic lexing functions from GF.Text.Lexing to the new module PGF.Lexinghallgren
They are thus part of the PGF Run-Time Library, making it possible to add lexing functionality in PGF service in a natural way.
2014-03-12ensure that negative probabilities are always avoidedkr.angelov
2014-02-10Restore compatibility with GHC 7.0hallgren
2014-02-04PGF.Optimize: one more fix for unsafeFreezehallgren
2014-02-04PGF.Optimize: import unsafeFreeze from Data.Array.Unsafe for compatibility ↵hallgren
with ghc-7.8
2014-01-31fix in the bracketedLinearize in Haskellkr.angelov
2014-01-24fix in the Haskell runtimekr.angelov
2013-12-17Add backward compatibility for reading old PGF fileshallgren
Some backwards incompatible changes were made to the PGF file format after the release of GF 3.5. This patch adds a module for reading PGF files in the old format. This means that old PGF files on the grammaticalframework.org server will continue to work after we install the latest version of GF.
2013-12-10bugfix in the grammar splitterkr.angelov
2013-12-10option --split-pgf replaces option --mk-index. This splits the PGF into one ↵kr.angelov
file for the abstract and one more for each concrete syntax. This is a preparation for being able to load only specific languages from the whole grammar.
2013-11-29-optimize-pgf should also apply to the linrefskr.angelov
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-22the GF syntax for identifiers is exteded with quoted forms, i.e. you could ↵kr.angelov
write for instance 'ab.c' and then everything between the quites is identifier. This includes Unicode characters and non-ASCII symbols. This is useful for automatically generated GF grammars.
2013-11-12added Predef.SOFT_BIND. This special token allows zero or more spaces ↵kr.angelov
between ordinary tokens. It is also used in the English RGL to attach the commas to the previous word.
2013-11-06Remove PGF.Signaturehallgren
This module should not be part of the public PGF library API, and it was only used in GF.CompileToAPI, so the code was moved there. The module defined constFuncs and syntaxFuncs, but only syntaxFuncs was used.
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-05linearization by chunks in the GF shell: a new command 'lc' needed because ↵aarne
'l' requires type checking and trees with metavariable function heads don't type check. This will hopefully be a temporary command.
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-30linref is now used by the linearizer. The visible change is that the 'l' ↵kr.angelov
command in the shell now can linearize discontinuous phrases
2013-10-30added the linref construction in GF. The PGF version number is now bumpedkr.angelov
2013-10-21fix the grammar serialization for nonExist and BINDkr.angelov
2013-10-03the symbol for nonExist in the GF runtime should be the last. this ↵kr.angelov
simplifies the binary search in the C runtime
2013-09-27a major refactoring in the C and the Haskell runtimes. Note incompatible ↵kr.angelov
change in the PGF format!!! The following are the outcomes: - Predef.nonExist is fully supported by both the Haskell and the C runtimes - Predef.BIND is now an internal compiler defined token. For now it behaves just as usual for the Haskell runtime, i.e. it generates &+. However, the special treatment will let us to handle it properly in the C runtime. - This required a major change in the PGF format since both nonExist and BIND may appear inside 'pre' and this was not supported before.
2013-09-03fix for linearization with 'pre'kr.angelov
2013-09-03fix in the GF compiler and runtime which let us to define pre construct ↵kr.angelov
detecting whether this is the last token.
2013-08-23nonExist now does the expected thingkr.angelov
2013-07-30the first approximation for a statistical model consistent with dependent ↵kr.angelov
types in the abstract syntax
2013-05-03[haskell runtime] Remove trailing whitespaces in VisualizeTree.hsgregoire.detrez
2013-04-21reverse the direction of the arcs in the dependency treeskr.angelov
2013-04-19remove the dead code left behind by Peter Ljunglöf in VisualizeTreekr.angelov
2013-04-16added a malt_tab format to the vd command in the GF shellkr.angelov
2013-04-16the generation of dependency trees in the Haskell runtime is now finally ↵kr.angelov
working with bracketed strings. This also fixes some errors in the old implementation
2013-04-15the compiler now sorts the list of functions per category in probability ↵kr.angelov
order. this ensures probability order search in the C runtime
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.
2013-04-02Replace "CId" with "Language" in type signature for PGF.tabularLinearizesjohn.j.camilleri
2013-01-29Avoid crash in random generation with probabilitieshallgren
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-11-22better visualization of parse treespeter.ljunglof
2012-08-30another fix for teyjuskr.angelov
2012-08-30the loading of PGF files was broken by the Teyjus patch. Now this is fixedkr.angelov
2012-08-29Use nub' instead of nub in some places, remove some unused nub importspeter.ljunglof
2012-08-29Added an O(n log n) version of nubpeter.ljunglof
The new nub is called nub', and it replaces the old sortNub which was not lazy and did not retain the order between the elements.
2012-08-29A basic infrastructure for generating Teyjus bytecode from the GF abstract ↵kr.angelov
syntax
2012-06-10command option ma -known to drop unknown wordsaarne
2012-03-26Fix List.foldl / Map.foldl ambiguositySergei Trofimovich
Fixes the following error: src/runtime/haskell/PGF/Expr.hs:111:14: Ambiguous occurrence `foldl' It could refer to either `List.foldl', imported from `Data.List' at src/runtime/haskell/PGF/Expr.hs:27:1-24 (and originally defined in `GHC.List') or `Map.foldl', imported from `Data.Map' at src/runtime/haskell/PGF/Expr.hs:28:1-40
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.