summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2015-09-02API for transactions in libsgkrasimir
2015-09-02added the minimal Haskell API for storing expressions/triples in the ↵krasimir
semantic graph
2015-09-02bugfix in libsgkrasimir
2015-09-02Wide coverage translation demo: make it easier to use with different grammarshallgren
2015-09-01added code for visualization of the sematic graph in the app. The code is ↵krasimir
there but the menu item for activating it is not there yet since the functionality is not complete
2015-08-31GF.Infra.SIO: The SIO monad now supports putStr in addition to putStrLnhallgren
Also included some unrelated minor changes.
2015-08-31still partial implementation for complex queries in libsg, and added sg.h ↵krasimir
which I had forgotten to include in darcs
2015-08-28Comment out some dead code found with -fwarn-unused-bindshallgren
Also fixed some warnings and tightened some imports
2015-08-27query for triples and cleaner APIkrasimir
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-24added libsg in the C runtimekrasimir
2015-08-21retrieval of a triplekrasimir
2015-08-21API for storing triples in the semantic graphkrasimir
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-21add a type signature in GF.Interactive2 to make ghc-7.6.3 happykrasimir
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-20PGF2: export BindType(..) and two new functions: showType & categorieshallgren
showType :: Type -> String categories :: PGF -> [Cat] But both are implemented as quick hacks: categories is implemented by listing all functions and taking the target categories from their types. showType uses ppType copied & modified from PGF.Type, and needs a ppExpr, which is currently implemented by wrapping showExpr... TODO: need something correpsonding to PGF.categoryContext.
2015-08-20add the initial sketches of the semantic graph storage krasimir
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".
2015-08-17GF shell: add the start options to GFEnv, turn "reload" into an ordinary commandhallgren
2015-08-13GF Shell: "ph | wf -file=foo.gfs" now works as advertisedhallgren
The print_history command was among the commands implemented in an ad-hoc way instead of being handled by the command line interpreter, which means it could not be used in a pipe, as in the example in the help info. The refactoring in the previous patch made this old bug easy to fix. Also fixed a bug in the "empty" command, introduced when moving the PGF from CommandEnv to GFEnv. TODO: fix the undocumented eh command. A comment in the help info for print_history, and some commented out old code, suggest that eh means "execute_history", but at present it does nothing...
2015-08-13GF Shell: refactoring for improved modularity and reusability:hallgren
+ Generalize the CommandInfo type by parameterizing it on the monad instead of just the environment. + Generalize the commands defined in GF.Command.{Commands,Commands2,CommonCommands,SourceCommands,HelpCommand} to work in any monad that supports the needed operations. + Liberate GF.Command.Interpreter from the IO monad. Also, move the current PGF from CommandEnv to GFEnv in GF.Interactive, making the command interpreter even more generic. + Use a state monad to maintain the state of the interpreter in GF.{Interactive,Interactive2}.
2015-08-12GF Shell: turn set_encoding into a common commandhallgren
Implemented in GF.Command.CommonCommands instead of GF.Interactive & GF.Interactive2.
2015-08-12GF.Interactive2: cleanuphallgren
2015-08-12Bugfix in the android app for Chinese which was causing the first character ↵krasimir
in the translation to disappear
2015-08-12GF shell: source commands (cc, sd, so, ss & dg) can now be used in pipeshallgren
These commands are now implemented as regular commands (i.e. using the CommandInfo data type) in the new module GF.Command.SourceCommands. The list of commands exported from GF.Command.Commmands now called pgfCommands instead of allCommands. The list allCommands of all commands is now assembled from sourceCommands, pgfCommands, commonCommands and helpCommand in GF.Interactive.
2015-08-12Move welcome message from GF.Interactive & GF.Interactive2 to ↵hallgren
GF.Command.Messages ...to avoid the duplication.
2015-08-11GF shell: make environment types abstract, comment out some dead codehallgren
2015-08-12pickling/unpickling for typeskrasimir
2015-08-12support for transparent pickling/unpickling of abstract expressions in Pythonkrasimir
2015-08-10gf -cshell: improved help for the 'import' commandhallgren
2015-08-10Factor out common code from GF.Command.Commands and GF.Command.Commands2hallgren
Created module GF.Command.CommonCommands with ~250 lines of code for commands that do not depend on the type of PGF in the environemnt, either because they don't use the PGF or because they are just documented here and implemented elsewhere. TODO: further refactoring so that documentation and implementation of *all* commands can be kept together.
2015-08-10gf -cshell: preliminary support for the C run-time system in the GF shellhallgren
Some C run-time functionality is now available in the GF shell, by starting GF with 'gf -cshell' or 'gf -crun'. Only limited functionality is available when running the shell in these modes: - You can only import .pgf files, not source files. - The -retain flag can not be used and the commands that require it to work are not available. - Only 18 of the 40 commands available in the usual shell have been implemented. The 'linearize' and 'parse' commands are the only ones that call the C run-time system, and they support only a limited set of options and flags. Use the 'help' commmands for details. - A new command 'generate_all', that calls PGF2.generateAll, has been added. Unfortuntaly, using it causes 'segmentation fault'. This is implemented by adding two new modules: GF.Command.Commands2 and GF.Interactive2. They are copied and modified versions of GF.Command.Commands and GF.Interactive, respectively. Code for unimplemented commands and other code that has not been adapted to the C run-time system has been left in place, but commented out, pending further work.
2015-08-10Refactor GF shell modules to improve modularity and reusabilityhallgren
+ Move type CommandInfo from GF.Command.Commands to a new module GF.Commands.CommandInfo and make it independent of the PGF type. + Make the module GF.Command.Interpreter independent of the PGF type and eliminate the import of GF.Command.Commands. + Move the implementation of the "help" command to its own module GF.Command.Help
2015-08-10bump the version number for the Android appkrasimir
2015-08-06now the app shows the correct abstract syntax names for unknown words while ↵krasimir
it still produces the right TTS
2015-08-06another fix in the Thai keyboardkrasimir
2015-08-06disable the visualization of glosses in the App until we have a complete ↵krasimir
database
2015-08-06set the optimization levels for the JNI code to release levelkrasimir
2015-08-06bugfix for the word prediction in the Appkrasimir
2015-08-06a better layout for the Thai keyboardkrasimir
2015-08-06bugfix in lookup_morpho in the C runtimekrasimir
2015-07-21PGF web service: option to leave &+ uninterpreted in linearized outputhallgren
By adding unlexer=none (or unlexer=id) in requests that output linearizations (e.g. command=linearize, command=translate), you can leave &+ uninterpreted instead of gluing the adjacent tokens. This means that the output is left in a format that can be parsed in a subsequent request. To implement this consistently, the function linearizeAndBind was replaced with the function linearizedAndUnlex (but there are a couple of requests that do not call this function...) Note that this applies to the Haskell run-time requests only. The C run-time request (c-linearize, c-translate) always applies the &+ token and the c-parse request can parse input containing glued tokens.
2015-07-16make the virtual machine instructions more uniformkrasimir
2015-07-16refine the GNU lightning patch to avoid generating unnecessary codekrasimir
2015-07-16bugfixes in the JIT compiler for x86_64. One of the fixes is actually in GNU ↵krasimir
lightning
2015-07-16added a space after the tag in word alignment to work around a graphviz bug ↵aarne
shown with Chinese characters