1
0
forked from GitHub/gf-core
Commit Graph

254 Commits

Author SHA1 Message Date
Krasimir Angelov
bbdbf2bc5d silence Tab warnings in the Haskell runtime 2017-09-01 14:31:08 +02:00
Krasimir Angelov
b7b7a7c91c the embedded grammars now work with both the pure Haskell and the Haskell binding API 2017-08-29 18:44:50 +02:00
Krasimir Angelov
00388039f1 a nicer pretty printing for the PGF format 2017-08-22 21:13:21 +02:00
Krasimir Angelov
0a3b822313 ????
Merge branch 'master' of www.grammaticalframework.org:/usr/local/www/GF
2017-08-18 21:27:40 +02:00
Krasimir Angelov
1f3c9d0b17 the parser is not forced to respect the linref while parsing discontious phrases 2017-08-18 21:23:58 +02:00
Thomas Hallgren
0a0eaa01bc Bump version requirements to base>=4.6, Cabal>=1.20
Cabal>=1.20 allows control over parallelism when compiling grammars from
Setup.hs and WebSetup.hs.

base>=4.6 allows conditional compilation with CPP to be eliminated from
a few modules.

base-4.6 corresponds to GHC 7.6.3, which is what you get in
Debian 8 (aka jessie, aka oldstable) from 2015.
2017-08-18 11:55:44 +02:00
Thomas Hallgren
a0e7e3bf83 A couple of fixes for GHC 8.2.1 compatibility 2017-08-11 10:07:43 +02:00
aarne
9e206496a7 handling combination of &+ and &| 2017-06-02 06:11:44 +00:00
aarne
d1eb0aa657 handling capitalization (&|) in unlexer -bind 2017-06-02 06:06:57 +00:00
aarne
b789f90da9 separated syncat multiwords in dep tree generation ; added function wildcards to concrete annotatations (see for instance english/LangEng.labels) 2017-04-06 15:40:44 +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
krasimir
20a038719f added generateOntology & generateOntologyDepth 2017-04-05 11:08:31 +00:00
aarne
630b9d7b1e added a default value in dependency visualization for cases using maximum, to cover the case where the list of arcs is empty 2016-06-15 10:37:00 +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
c9ea17d293 PGF.VisualizeTree: add white background in the SVG rendering of dependency trees
This makes them look the same as SVG produced by graphviz
2016-06-08 19:08:29 +00:00
hallgren
8dfdee1e9a PGF.VisualizeTree: add SVG renderering of word dependency trees
This was done by introducing an intermediate representation for the LaTeX
pictures produced by the LaTeX renderer and providing a new backend that
outputs SVG instead of LaTeX.
2016-06-08 17:49:15 +00:00
aarne
4fea4ace7b vd latex: some adjustments in heights and lengths 2016-06-03 16:06:22 +00:00
aarne
f5e2c41dd0 vd: arc heights now depend on number of arcs below rather than word distance 2016-06-02 18:17:54 +00:00
hallgren
389e6b8816 Add haddock documentation to PGF.graphvizDependencyTree and PGF.getDepLabels
They seemed very difficult to use without the documentation, since their
types are not particularly self documenting.

Also documented what the (Bool,Bool) argument to PGF.graphvizAbstractTree
is for.
2016-05-26 13:12:38 +00:00
hallgren
0f51bf3538 Fix documentation typo on PGF.Haskell 2016-05-26 13:11:56 +00:00
aarne
74e17aef08 made the word length proportionate in dependency visualization, instead of using the max length for every word 2016-05-23 19:16:06 +00:00
leiss
672c1e8df5 add forgotten file src/runtime/haskell/PGF/LexingAGreek.hs 2016-02-23 17:32:19 +00:00
aarne
0a38e137b6 vd -conll2latex now converts conll to latex. Without going through GF trees, but as a service to the dependency parser community. 2015-11-23 10:43:03 +00:00
aarne
9335a2997c reduced label size and optimized arc length in vd -output=latex 2015-11-18 08:12:26 +00:00
aarne
cda3feaf9f latex visualization of dep trees: explained the program better and eliminated most magic numbers 2015-11-17 18:08:32 +00:00
aarne
d6a505169a added -output=latex to visialize_dependencies. This generates more 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-17 09:11:10 +00:00
aarne
e97fa30c9d vp -showdep: as default label for the first (incl. only) argument, don't use dep#0 but assume it is the head 2015-11-05 08:30:13 +00:00
aarne
eb49b6ab56 improved documentation of vp -showdep 2015-11-05 08:23:33 +00:00
aarne
0786dc6f42 dependency labels in parse trees now with the -deps flag, -file=labels_file 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-04 20:36:47 +00:00
aarne
e39787ab88 prepared visualize_parse for showing dependency labels 2015-11-04 17:28:09 +00:00
hallgren
1c86783e17 GF.Infra.SIO: The SIO monad now supports putStr in addition to putStrLn
Also included some unrelated minor changes.
2015-08-31 12:22:13 +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
aarne
3ad6e0c6bc added a space after the tag in word alignment to work around a graphviz bug shown with Chinese characters 2015-07-16 08:36:14 +00:00
hallgren
22ba8d34ff Bump version of .gfo and .pgf files, improve error messages on version mismatch
Becacuse of the new special tokens added to the Symbol type, .gfo and .pgf
files produced with the current version of GF can not always be used with
older versions of GF and the PGF run-time system.

The PGF version number was increased from (2,0) to (2,1). GF can still
read version (2,0) and (1,0), so old PGF files continue to work.

The GFO version was increased from "GF03" to "GF04".
2015-06-23 12:58:14 +00:00
krasimir
2f2f459a89 forgot changes in the serialization in the Haskell runtime 2015-06-17 12:58:46 +00:00
krasimir
ac01e5019a fixed typo in the Haskell runtime 2015-06-11 07:41:28 +00:00
krasimir
1e0d7be4f4 added all orthographic primitives 2015-05-11 13:01:39 +00:00
krasimir
8c697b72a4 drop the dependency to FST 2015-04-20 11:56:13 +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
956b721048 Restore compatibility with ghc-7.4
With ghc-7.4 'import M hiding (x)' causes an error if M does not export x...
2015-02-16 15:41:38 +00:00
hallgren
54ae70a81e Changes for compatibility with ghc-7.10-rc2
2 modules: Name clashes caused by Applicative-Monad change in Prelude
2 modules: Ambiguities caused by Foldable/Traversable in Prelude
2 modules: Backwards incompatible changes in time-1.5 for defaultTimeLocale
9 modules: {-# LANGUAGE FlexibleContexts #-} (because GHC checks inferred types
           now, in addition to explicitly given type signatures)

Also silenced warnings about tab characters in source files.
2015-02-16 15:05:06 +00:00
hallgren
2b8fe8ea7a PGF.Haskell: adding operators for selections from tables 2015-02-12 16:09:33 +00:00
hallgren
8e4e8da105 Translating linearization functions to Haskell: support for variants
By adding the flag -haskell=variants to the command line, GF will now generate
linearization functions in Haskell that support variants. Variants are
represented as lists in Haskell.

Variants inside pre { ... } expressions are still ignored.

TODO: apply some monad laws to generate more compact code (using an
intermediate representation of the generated Haskell code, instead of
pretty printing directly from the GF code).
2015-02-09 16:24:33 +00:00
hallgren
7e1120d271 Translating linearization functions to Haskell: move a common record type to PGF.Haskell
Move the Haskell representation of the common linearization type {s:T} to the
shared module PGF.Haskell, so that the same overloaded projection function
proj_s can be used for all concrete syntaxes.
2015-01-19 12:43:32 +00:00
hallgren
20b271a238 Translating linearization functions to Haskell: better treatment of special tokens
Common code has been lifted out from the generated Haskell modules to
an auxiliary module PGF.Haskell, which is currently included in the
regular PGF library, although it is independent of it and probably belongs
in a separate library.

The type Str used by linearization functions is now based on a token
type Tok, which is defined in PGF.Haskell.

PGF.Haskell.Tok is similar to the type GF.Data.Str.Tok, but it has
constructors for the special tokens BIND, SOFT_BIND and CAPIT, and there is
a function

	fromStr :: Str -> String

that computes the effects of these special tokens.
2015-01-14 14:35:39 +00:00
kr.angelov
b1e6a21c56 now (+) in the abstract syntax works, i.e. it knows how to deal with partial sums 2014-10-31 14:16:11 +00:00
kr.angelov
9b0f354c7c a more efficient tail call by using the new TUCK instruction 2014-10-30 13:09:50 +00:00
kr.angelov
efedec187c an explicit SAVE instruction 2014-10-26 11:40:12 +00:00
kr.angelov
c8b3865338 an explicit PUSH_FRAME instruction 2014-10-22 14:11:41 +00:00
aarne
84bce336fd (un)lexmixed: added the other math environments than $ used in latex 2014-10-19 17:43:39 +00:00