summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Command
AgeCommit message (Collapse)Author
2017-09-05update documentation for command ptKrasimir Angelov
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-09-04pt -paraphrase was never properly implemented and is now removedKrasimir Angelov
2017-09-04eliminate modules PGF.Lexing, PGF.LexingAGreek. Make PGF.Utilities an ↵Krasimir Angelov
internal module in the runtime. These are not really part of the core runtime.
2017-09-01added command "rt" in the C shellKrasimir Angelov
2017-09-01the C shell now type checks expressions before they are usedKrasimir Angelov
2017-09-01complete details for the "ai" command in the C shellKrasimir Angelov
2017-09-01added function treeProbability in the Haskell bindingKrasimir Angelov
2017-09-01giza alignment in the C shellKrasimir Angelov
2017-08-31graphvizWordAlignment in the C runtimeKrasimir Angelov
2017-08-31the C runtime now supports the same customizations for GraphViz as the ↵Krasimir Angelov
Haskell runtime
2017-08-31remove move dead code in the C shellKrasimir Angelov
2017-08-30some dead code eliminationKrasimir Angelov
2017-08-30an almost complete ai command in the C shellKrasimir Angelov
2017-08-30implement rf in the C shellKrasimir Angelov
2017-08-30pg in the C shell now supports most output formatsKrasimir Angelov
2017-08-30remove some dead code in the C shellKrasimir Angelov
2017-08-30in the C shell rename the ga command to gt to be consistent with the ↵Krasimir Angelov
standard shell
2017-08-30"lc" was a temporary hack and is now removed from the C shellKrasimir Angelov
2017-08-30"ma" command in the C shellKrasimir Angelov
2017-08-30the l command in the C shell now supports the same options as in the normal ↵Krasimir Angelov
shell
2017-04-06vd command now reads local concrete configurations to deal with syncat ↵aarne
words; TODO: dissolve clustered multiwords bound with +
2017-02-21Fix compilation errors caused by changes in PGF2hallgren
These prevented GF from being built with C run-time support (-fc-runtime).
2017-01-25improve the documentation for PGF2krasimir
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".
2016-05-22Changes for compatibility with GHC 8.0.1hallgren
2016-04-07GF.Command.Commands2: adapt gf -cshell to the changes in the previous patchhallgren
2016-04-07GF shell: fix a parsing problem with the cc commandhallgren
This patch fixes a problem introduced last year when the GF shell was refactored to allow more commands to be treated uniformly and be part of pipes. The cc command was one of those commands, but unfortunately this introduced a parsing problem, e.g. > cc "last" constant not found: last > cc "last"++"year" command not parsed: cc "last"++"year" This happened because the generic command line parser in GF.Command.{Abstract,Parse} assumes that all commands have an argument of type PGF.Expr. Commands that expect other types of arguments have to use PGF.showExpr combined with other conversion to the argument type they expect. The cc command excpets a GF.Grammar.Term, and unfortunately not all terms survice the roundtrip through PGF.Expr, in part because of an additional hack to allow strings to be roundtripped through PGF.Expr without adding superfluous double quotes. To solve the problem, this patch + makes room for arguments of type Term in the Argument type in GF.Command.Abstract. + makes a special case for the cc command in GF.Command.Parse, by calling the partial parser 'runPartial pTerm' recently added in GF.Grammar.Lexer and GF.Grammar.Parser. Care was taken so that that "|" and ";" can be used both inside terms and as separators between commands in the shell, e.g. things like the following now work: > cc ("a"|"b") | ps -lexcode variants { "a" ; "b" } + introduces a type CommandArgument that replaces [Expr] as the type of values passed between commands in pipes. It has room for values of type [Expr], [String] and Term, thus eliminating the need to roundtrip through the Expr type all the time. The hack to avoid adding superfluous quotes when strings are roundtripped through Expr has been left in place for now, but can probably be removed.
2016-03-22fix the handling of separators in BNFC which are not nonemptykrasimir
2016-03-22CFGtoPGF is now extended to support context-free grammars with primitive ↵krasimir
parameters
2016-03-21initial support for BNFC syntax in context-free grammars for GF. Not all ↵krasimir
features are supported yet. Based on contribution from Gleb Lobanov
2016-02-23add lexer and unlexer for Ancient Greek accent normalizationleiss
2015-12-02GF shell, cc command: try to compute pre{...} tokens in token sequenceshallgren
This is implemented as a simple post-processing step after partial evaluation to try compute pre{...} tokens in token sequences. Nothing is done to deal with intervening free variants. This was done in response to a query from René T on the gf-dev mailing list.
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-17added -output=latex to visialize_dependencies. This generates more ↵aarne
familiar-looking output than the default graphviz, which can moreover be pasted into LaTeX documents. Some more work is needed to make long sentences look nice and fit on a page; a constant word length is now used to simplify computing the coordinates.
2015-11-05the visualization commands (aw,vd,vp,vt) can now show multiple trees. ↵aarne
Previously they only showed one tree even if there were for instance after ambiguous parsing. The reason was that dot (graphviz) ignored all graphs but the first one. Now the graphs are put into separate files. The 'convert' command from ImageMagick package is used to combine them to one pdf. If this is a problem, the old behaviour can be restored by the -number=1 option to the tree-generating command, which cuts away all trees but the one and doesn't require ImageMagick.
2015-11-05improved documentation of vp -showdepaarne
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-11-04prepared visualize_parse for showing dependency labelsaarne
2015-09-28Preliminary new shell feature: cc -trace.hallgren
You can now do things like cc -trace mkV "debug" to see a trace of all opers with their arguments and results during the computation of mkV "debug".
2015-09-03GF shell: write_file now writes one tree per linehallgren
This compensates for other changes that removed line breaks. Maybe it should have a -lines options like ps and rf?
2015-08-28Comment out some dead code found with -fwarn-unused-bindshallgren
Also fixed some warnings and tightened some imports
2015-08-26GF shell: change parse & linearize to obtain useful results from p|l and l|p ↵hallgren
in more cases These changes are inspired by the gf -cshell implementation of these commands. The output of the linearize command has been changed to remove superfluous blank lines and commas, and deliver the result as a list of strings instead of a single multi-line string. This makes it possible to use -all and pipe the results to the parse command. This also means that with -treebank -all, the language tag will be repeated for each result from the same language. The parse command, when trying to parse with more than one language, would "forget" other results after a failed parse, and thus not send all successful parses through the pipe. For example, if English is not the first language in the grammar, p "hello" | l would output nothing, instead of translations of "hello" to all languages, forcing the user to write p -lang=Eng "hello" | l instead, to get the expected result. The cause of this behaviour was in the function fromParse, which was rather messy, so I assume it is not intentional, but the result of a programming mistake at some point. The fromParse function has now been refactored from a big recursive function into fromParse opts = foldr (joinPiped . fromParse1 opts) void where the helper functions fromParse1 deals with a single parse result and joinPiped combines multiple parse results.
2015-08-21GF shell bug fix: visualize_parse didn't accept the -lang flaghallgren
Even though the -lang flag was handled in the implementation, it was not documented, and GF.Command.Interpreter rejects undocumented flags: option not interpreted: lang This must be a fairly old bug, so it suggests that the vp command isn't used much...
2015-08-21GF -cshell: implement visualize_parsehallgren
Supported options and flags: -lang -format -view None of the rendering options available in the Haskell run-time are supported.
2015-08-21gf -cshell: implement visualize_treehallgren
But the following options are not supported: -mk -nocats -nofuns
2015-08-20gf -cshell: implement a subset of print_grammar and abstract_infohallgren
pg supports only the -funs, -cats and -langs output modes. ai IDENTIFIER shows info about a category or a function. ai can not type check and refine metavariables in expressions.
2015-08-18gf -cshell: linearize: implement options -all -list -treebankhallgren
Options -all and -list use PGF2.linearizeAll, which lists all variants, but not all forms... Also, there is no attempt to be compatible with the output from the Haskell run-rime shell, which produces superfluous blank lines (-all) or commas (-list), and mixes tagged and untagged lines (-treebank -all).
2015-08-18GF shell: restore the eh command to working order and document ithallgren
Also, when the command line parser fails, append the problematic command line to the error message "command not parsed".