1
0
forked from GitHub/gf-core
Commit Graph

97 Commits

Author SHA1 Message Date
krasimir
72fc90d13e safer memory management in the Haskell binding 2017-02-10 17:10:37 +00:00
krasimir
4fae6e89a3 API for computing the Haskell binding 2017-01-26 18:41:07 +00:00
krasimir
22c10a1a27 use throwIO instead of throw in a few placed 2017-01-26 18:40:36 +00:00
krasimir
e47b8a1cbc type checking API in the Haskell binding 2017-01-26 14:09:07 +00:00
krasimir
cf1a1c3e3c a better implementation for PGF2.categories 2017-01-26 13:37:12 +00:00
krasimir
d687413052 forgot to add src/runtime/haskell-bind/PGF2/Type.hsc 2017-01-26 13:00:22 +00:00
krasimir
74b0df2b6b bring the Haskell binding a bit closer to the pure Haskell API 2017-01-26 12:48:22 +00:00
krasimir
99b88d0014 copy the types for BracketedString from the Haskell runtime to the Haskell bindings 2017-01-26 10:31:43 +00:00
krasimir
06450249e3 added mkMeta and unMeta in the Haskell binding 2017-01-26 10:17:02 +00:00
krasimir
47a4363d07 added mkAbs and unAbs in the Haskell binding 2017-01-26 10:04:42 +00:00
krasimir
45dd793f50 more startCat to the Types section in the Haddock documentation for the Haskell binding 2017-01-26 06:41:27 +00:00
krasimir
4442e302e6 add unStr,unInt and unFloat in the Haskell binding 2017-01-26 06:40:13 +00:00
krasimir
00f15826af improve the documentation for PGF2 2017-01-25 20:30:54 +00:00
krasimir
3279210cd7 add functionsByCat in the Haskell binding 2017-01-25 10:44:08 +00:00
krasimir
d747fcb897 bugfix in the Haskell binding 2017-01-25 10:37:34 +00:00
krasimir
3fe2347bfd fix in the Haskell binding: functionType should throw error if the function is not defined 2016-05-30 17:15:09 +00:00
krasimir
4ce95de1bc the Literals API in Haskell no longer offers the sentence as an argument to the callbacks. It is just as easy to save the sentence in a closure and by doing that we save the repeated round about from C to Haskell strings 2016-05-11 11:10:22 +00:00
krasimir
ff11f2f963 many of the uses of peekCString and withCString in the Haskell binding were incorrect since they encode the string in the system locale while the C runtime is always using UTF8 2016-05-11 07:11:45 +00:00
krasimir
82a0634103 fix the offset for oracles in Haskell 2016-05-10 19:41:44 +00:00
krasimir
7cb772ffdb an API for oracles in the GF parser 2016-05-10 17:11:39 +00:00
krasimir
44d7ccf6de a prototype for complex queries over expressions in libsg 2016-04-29 14:06:24 +00:00
krasimir
9483ad219b added API for reading a list of tuples in the SG module 2015-12-22 13:50:01 +00:00
krasimir
6bf691c3af added a primitive full-text search index in libsg. This can be use for finding an abstract tree whose linearization matches given keywords 2015-12-20 14:04:52 +00:00
krasimir
63261ad94a added readTriple in libsg and its Haskell binding 2015-11-25 10:37:13 +00:00
krasimir
4888b65881 added mkInt and mkFloat in the Haskell binding to make it easy to create literal expressions 2015-11-19 13:18:19 +00:00
hallgren
cf959444a2 haskell-bind/SG.hsc: fix unsafePerformIO import problem with ghc>=7.8 2015-09-14 11:42:42 +00:00
hallgren
a976a49cef PGF2.Expr: a fix for ghc-7.6
Apparently Foreign.unsafePerformIO is not just a re-export of
System.IO.Unsafe.unsafePerformIO (or vise versa), it is a different function,
so you get an ambiguity if you import both.
2015-09-10 15:07:48 +00:00
krasimir
1196b48b5e add readTriple in the Haskell binding 2015-09-08 13:04:31 +00:00
krasimir
9f37d11107 the Haskell binding now covers everything in the libsg API 2015-09-04 10:02:42 +00:00
hallgren
dab749a956 PGF2.Expr fixes
It needs to be listed in gf.cabal
unsafePerformIO is only exported from System.IO.Unsafe, starting with ghc-7.8
2015-09-03 20:41:00 +00:00
krasimir
2ae4468738 added the minimal Haskell API for storing expressions/triples in the semantic graph 2015-09-02 07:12:36 +00:00
hallgren
d2217c0715 PGF2: export BindType(..) and two new functions: showType & categories
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-20 15:55:24 +00:00
hallgren
230d9780b7 gf -cshell: preliminary support for the C run-time system in the GF shell
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-10 14:12:51 +00:00
krasimir
8b3d6059c6 fixed missing do in the Haskell binding 2015-07-12 15:37:45 +00:00
krasimir
85e6e017af merge the states for reasoning and evaluation into a single structure 2015-07-03 11:53:52 +00:00
krasimir
02fd379649 add function 'functions' in the Haskell binding to the C runtime 2015-06-30 20:42:19 +00:00
krasimir
4347ce727a the NERC in C is now fully up-to-date with the other NERCs. In addition the NERC in Haskell and Java now refuses to recognize names that match words in the lexicon. The latest is useful for German 2015-05-19 07:26:56 +00:00
krasimir
3ebadcbc3b the callbacks in C now take the concrete syntax as a parameter 2015-05-18 14:41:33 +00:00
krasimir
e83d2b590b use a temporary pool for linearizeAll in Haskell too 2015-04-27 19:39:16 +00:00
krasimir
57704a1b51 make linearizeAll in the Haskell binding lazy 2015-04-27 16:28:45 +00:00
aarne
f0f1748360 some translate.probs decreased ; fine-tuning in pgf-hsbind-trans 2015-04-21 14:13:13 +00:00
krasimir
bfc2df3d04 fix in the Haskell binding for Windows 2015-04-20 09:55:15 +00:00
aarne
168e6a04d8 pgf-hsbind-trans now with linearizeAll 2015-04-17 14:33:28 +00:00
hallgren
54b69e25ea pgf-shell.hs: remove call to performGC and document the 'i' command 2015-04-17 13:34:41 +00:00
krasimir
a76ea1a99b added linearizeAll in the Haskell bindings 2015-04-17 12:33:22 +00:00
aarne
3ddbc44789 simplified the example translator and renamed it to pgf-hsbind-trans 2015-04-16 13:51:18 +00:00
aarne
23992d412d extended pgf-shell functionalities: batch translation with many trees, and intervening context-dependent tree manipulation 2015-04-15 15:53:44 +00:00
hallgren
fac915e783 haskell-bind: add bindings to graphviz rendering functions for abstract&parse trees 2015-03-19 14:14:30 +00:00
krasimir
4ff6728993 fix the missmatch between Int and CInt in the Haskell binding to the word alignment API. This was causing problems on 64-bit machines 2015-02-18 17:05:35 +00:00
krasimir
f3f47c7761 fix the callback for unknown words as well 2015-02-18 16:47:33 +00:00