Commit Graph

353 Commits

Author SHA1 Message Date
krangelov
155657709a Merge branch 'master' into c-runtime 2021-07-30 11:20:04 +02:00
John J. Camilleri
0954b4cbab More cabal file cleanup. Remove some more tabs from Haskell source. 2021-07-07 13:04:09 +02:00
Inari Listenmaa
6efbd23c5c Merge pull request #84 from ffrixslee/issue-46
Issue 46 (various deprecations during compilation of GF)
2021-06-29 23:48:00 +02:00
krangelov
af1360d37e allow parameter cat in the Web API for parsing 2021-05-27 11:45:31 +02:00
Liyana
54e5fb6645 Added explicit implementation for 'readJSON' in the instance declaration for 'JSON PGF.Trie' 2020-11-10 17:19:18 +08:00
Andreas Källberg
3bd1f01959 Fix a few warnings 2020-08-05 18:48:24 +02:00
krangelov
830dbe760d expose parseToChart via the Web API 2020-07-26 15:56:54 +02:00
krangelov
62bc78380e lookupCohorts now detects and reports unknown words. Also:
- added added two filtering functions: filterLongest and filterBest
 - updated the PGF service to work with the new API
2020-05-14 15:03:30 +02:00
krangelov
98a18843da support command c-lookupCohorts 2020-02-13 14:51:03 +01:00
krangelov
61641e7a59 support post requests to the server 2020-02-13 14:50:23 +01:00
Thomas Hallgren
33aeb53f7a PGFService: userLanguage now defaults to English, if present in the grammar
The userLangauge is the name of the concrete syntax that has a languageCode
that matches the user's preferred language, as reported by the web browser.
If no matching language code is found, the PGF service now sets userLanguage
to the concrete syntax for English (e.g. FoodsEng) if present, and defaults
to the first concrete syntax (e.g. FoodsAfr) only if English is not present
in the grammar.
2019-11-26 15:27:02 +01:00
Thomas Hallgren
28f53e801a PGFService: revert unlexing change in PGFService to restore &+ behaviour 2019-11-18 13:20:41 +01:00
krangelov
acb70ccc1b cleanup 2019-09-19 22:30:08 +02:00
krangelov
4a71464ca7 Merge with master and drop the Haskell runtime completely 2019-09-19 22:01:57 +02:00
krangelov
e993ae59f8 drop the haskell runtime, part 2 2019-09-19 10:06:06 +02:00
krangelov
148590927c remove obsolete code 2019-08-18 09:09:40 +02:00
Thomas Hallgren
86066d4b12 Eliminate the dependency on time-compat
It was only needed for compatibility with directory<1.2, but
directory>=1.2 has been shipped with ghc since ghc-7.6.

Note: time-compat-1.9.* (the current version) is a completely different
package, that does not provide the needed function toUTCTime, which
was provided in time-compat-0.1.*.
2019-05-15 12:05:38 +02:00
krangelov
fc37bc26cd fixed typo on c-bracketedLinearize 2019-02-26 21:10:06 +01:00
krangelov
2fdfef13d8 added command c-bracketedLinearize 2019-02-26 15:16:36 +01:00
Krasimir Angelov
7c97e5566d fix after the change in bracketed string 2018-12-20 12:40:46 +01:00
John J. Camilleri
507236fdcd remove gf-server.cabal 2018-11-28 13:40:16 +01:00
John J. Camilleri
735f5ff76f Remove src/ui folder, moved to:
https://github.com/GrammaticalFramework/gf-offline-translator
2018-11-15 10:33:31 +01:00
Krasimir Angelov
5a2b200948 manually copy the "c-runtime" branch from the old repository. 2018-11-02 14:38:44 +01:00
Thomas Hallgren
4fd1ec71c9 gf-server.cabal: relax network version bounds and make building the library and pgf-service executable optional
This allows you to build the content-service without installing the problematic fastcgi library.
2018-07-31 14:29:18 +02:00
Krasimir Angelov
ebe7cb3b73 A new function called "completions" is added in the Haskell runtime and used in PGFService. This makes the extraction of completions more platform independent 2017-09-06 15:17:28 +02:00
Krasimir Angelov
15d014abb8 the parser in the C runtime can now detect incomplete sentences just like the parser in the Haskell runtime. This is also reflected in all bindings. 2017-09-06 12:38:42 +02:00
Krasimir Angelov
1f908fa7bf eliminate modules PGF.Lexing, PGF.LexingAGreek. Make PGF.Utilities an internal module in the runtime. These are not really part of the core runtime. 2017-09-04 11:43:37 +02:00
Krasimir Angelov
eaf9f0c3ac the C runtime now supports the same customizations for GraphViz as the Haskell runtime 2017-08-31 10:58:49 +02:00
Thomas Hallgren
a0e7e3bf83 A couple of fixes for GHC 8.2.1 compatibility 2017-08-11 10:07:43 +02:00
hallgren
766bc09058 PGFService.hs: fix problem when compiling without C run-time support
The previous patch introduced an indentation problem in the code that is used
when compiling without C run-time support.
2017-05-10 12:59:57 +00:00
hallgren
d620c62d0b PGFService: add CncLabels support to command=deptree
CncLabels are read from a file in the same directory as the PGF file and
with the same name as the concrete syntax + extension .labels, 
e.g. ResourceDemo.pgf would use labels from

	ResouceDemo.labels	(abslabels)
	ResouceDemoEng.labels	(clclabels)
2017-05-05 14:01:02 +00:00
aarne
ee2f3d085e vd command now reads local concrete configurations to deal with syncat words; TODO: dissolve clustered multiwords bound with + 2017-04-06 11:55:21 +00:00
hallgren
ae512e09e0 Fix compilation errors caused by changes in PGF2
These prevented GF from being built with C run-time support (-fc-runtime).
2017-02-21 13:21:59 +00:00
hallgren
83d340dbef PGFService: fix a type ambiguity when compiling without C run-time support
The function listCaches returns an empty list instead of the contents
of the cached C run-time system PGFs when compiled without C-run-time support
This gave rise to an ambiguity in GF.Server.
2016-06-17 11:32:40 +00:00
hallgren
096b4cfcee PGF service & minibar: only show dependency diagrams if the labels are known
+ 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-06-09 13:12:14 +00:00
hallgren
617624e2a8 PGFService: eleminate warning "Defined but not used: ‘serverError’" 2016-06-09 11:27:57 +00:00
hallgren
a59821eb80 PGF web service: switch to the new SVG rendering of word dependency trees
Also added the function outputText in CGIUtils.
2016-06-08 19:10:23 +00:00
hallgren
9f1da17d06 PGFService.hs: fix compilation problem when C run-time support is omitted 2016-05-26 13:56:43 +00:00
hallgren
cfdd9621ff PGF web service: add command=deptree
This is the web interface to PGF.graphvizDependencyTree.

Accepted parameters: format=<output_format>, to=<lang>, tree=<tree>.

Accepted output formats: latex, conll, malt_tab, malt_input, png, gif, svg, gv

Also, label information is taken from <path>.labels if present, where
<path>.pgf is the path to the PGF file.
2016-05-26 13:39:48 +00:00
krasimir
86c5423275 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
aarne
e39787ab88 prepared visualize_parse for showing dependency labels 2015-11-04 17:28:09 +00:00
hallgren
5bfaf10de5 Comment out some dead code found with -fwarn-unused-binds
Also fixed some warnings and tightened some imports
2015-08-28 13:59:43 +00:00
hallgren
e9c060d3f9 PGF web service: option to leave &+ uninterpreted in linearized output
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-21 14:21:49 +00:00
hallgren
3263968c79 gf -server: include grammar modification time in the info returned by /version 2015-04-17 13:21:20 +00:00
hallgren
9e3afea129 PGF web service: add command c-linearizeAll to obtain all variants
Implemented by calling the recently added function PGF2.linearizeAll.
2015-04-17 12:59:03 +00:00
hallgren
6d72126ffc PGF Service: add an option to return syntax trees in JSON format
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).
2015-03-24 17:37:43 +00:00
hallgren
5db57b1a58 PGF service: add commands c-abstrtree and c-parsetree
These are the C runtime variants of the absttree and parsetree commands. They
work in the same way, but support fewer rendering options.
2015-03-19 14:17:45 +00:00
hallgren
9c6b5df741 PGFService: make the restriction on parallelism more effective
Restrict the entire request handler instead of just the call to the C parser.
2015-02-25 16:08:21 +00:00
hallgren
e68370e463 PGFService.hs: text lexer: slightly smarter decapitalization of the first word of a sentence
Keep the first letter in upper case if it is followed by more upper case
letters.

(Also remove some left over debugging output.)
2015-02-24 15:04:06 +00:00
hallgren
f6cb6d172e PGF Service: limit the number of parallel calls to the C run-time parse function to 4 by default
The limit can be changed with the -j flag
2015-02-20 12:29:44 +00:00