Commit Graph
100 Commits
Author SHA1 Message Date
hallgren b0a4dfeddd translator/DictionarySwe.gf: change fetch_V2 from "dra ut" to "hämta" 2015-07-21 15:06:04 +00:00
hallgren 2fe31eca17 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 e4525d1565 translator/DictionarySwe.gf: film_V and shock_V2. 2015-07-20 14:45:58 +00:00
hallgren 47f7cf640d translator/DictionarySwe.gf: 38 new words
Also added wince_V in Dictionary.gf and DictionaryEng.gf
2015-07-20 14:23:46 +00:00
hallgren 0695fecad6 Setup.hs: correctly parse output from 'darcs changes' for newer versions of darcs
It worked with darcs-2.8 before, now it also works with darcs-2.10.
2015-07-20 13:02:49 +00:00
hallgren 6e93b3bd34 translator/DictionarySwe.gf: 26 new words and fixes 2015-07-16 13:11:15 +00:00
hallgren c14ca1eba4 Wide Coverage Demo: avoid errors if d3 or d3Tree can't be loaded 2015-07-15 14:07:26 +00:00
hallgren 47dbfdb831 translator/DictionarySwe.gf: called_A, injured_A, shocked_A & shoddy_N 2015-07-01 08:23:10 +00:00
hallgren 6fc3114e3e translator/DictionarySwe.gf: combined_A, combining_N & sleek_A 2015-06-29 14:01:47 +00:00
hallgren 03d3814501 Remove left over [...] from release notes, bump version number in gf.cabal to 3.7-darcs 2015-06-25 14:56:15 +00:00
hallgren f77fba354e Update home page, download page & release notes for GF 3.7. Bump version number in gf.cabal 2015-06-25 12:22:06 +00:00
hallgren 4e9e7c2bdd Documentation updates for the release of GF 3.7 2015-06-25 12:10:47 +00:00
hallgren 71c037b4df runtime/c/pf/jit.c: silence warning about alloca on MINGW32 2015-06-23 15:49:31 +00:00
hallgren 5390f6a862 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
hallgren 3e4e6d5337 WebSetup.hs: a note about parallel builds 2015-06-23 10:22:35 +00:00
hallgren 287be6ff2d doc/gf-developers.t2t: add a note about parallel builds
Also added a note that partial builds (cabal build rgl-none, etc) doesn't work
with newer versions of cabal.
2015-06-23 10:20:04 +00:00
hallgren dbe00ecfac Remove the automatically generated doc/gf-developers.html 2015-06-22 15:10:37 +00:00
hallgren a5cbc648e9 Adding download/release-next.t2t (to be renamed) with preliminary release notes for the next release
You can use 'darcs changes --from-tag=RELEASE-3.6' to get a list of changes
since the previous release and extract noteworthy changes from there.
2015-06-11 13:55:18 +00:00
hallgren a1c5cfb55f translator/DictionarySwe.gf: fix brush_V2 2015-05-27 16:02:47 +00:00
hallgren 7c9e860d87 Wide Coverage Translation Demo: add buttons for speech output
Also fixed a problem with showing inflections for words containing underscores
(e.g. race_2_N).
2015-05-27 13:29:41 +00:00
hallgren d64bb8b83d minibar: moved 2 reusable functions from minibar_translations.js to minibar_support.js 2015-05-27 13:28:40 +00:00
hallgren fc7c285e52 examples/phrasebook/Makefile2: include Jpn and Snd in the build 2015-05-21 15:01:27 +00:00
hallgren 941d6ea0ea Omit -optimize-pgf when compiling small example grammars
The minibar lets the user choose any category as the start category, but this
can lead to run-time errors for grammars compiled with -optimize-pgf.

The problem can also be observed in the GF shell. For example, 
"linearize Fish" (which means that the start category is Kind) fails for 
some languages when Foods.pgf is compiled with -optimize-pgf.
2015-05-21 14:44:20 +00:00
hallgren 602b6fffae Fixed a problem with minibar when invoked from gfse or the syntax editor
Minibar needs js/langcode.js now, so need to include it in gfse/index.html
and syntax-exitor/editor.html too.
2015-05-21 08:00:49 +00:00
hallgren 1173ebc230 minibar: cosmetic fix for the "To:" menu 2015-05-19 14:26:39 +00:00
hallgren 4211511dfb minibar: more work on speech output 2015-05-19 13:38:42 +00:00
hallgren 975b39716a minibar: speech output (experimental) (in browsers that support it) 2015-05-18 15:58:57 +00:00
hallgren a73af40230 minibar: use SVG instead of PNG for trees and alignment diagrams if supported by the browser 2015-05-18 14:54:29 +00:00
hallgren 512fbb49e6 GF cloud: updated lists of supported RGL languages and some minor style updates 2015-05-18 13:16:45 +00:00
hallgren c1c58f9919 translator/DictionarySwe.gf: fixes for landslide_N, mudslide_N and race_2_N 2015-05-07 13:48:51 +00:00
hallgren dfd42bade2 GF.Haskell: small pretty printing improvement 2015-05-05 14:06:20 +00:00
hallgren c13f5a0d68 GF.CompileOne: use random numbers to avoid temporary file name clashes
When using make -j to compile examples/app or examples/phrasebook, since
the dependencies are not completely specified in the Makefiles, it can
happen that the same file is compiled at the same by more than one process,
resulting in an error when they try to write the same .gfo.tmp file. Adding a
random number to the temporary file name avoids this problem.
2015-05-05 13:51:35 +00:00
hallgren 54b69e25ea pgf-shell.hs: remove call to performGC and document the 'i' command 2015-04-17 13:34:41 +00:00
hallgren 409f7ab3e3 gf -server: include grammar modification time in the info returned by /version 2015-04-17 13:21:20 +00:00
hallgren 69a192308b 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 8c27daca37 translator/DictionarySwe.gf: fix hug_V2 2015-04-17 11:33:28 +00:00
hallgren 9495fc309f Wide Coverage Translation Demo: length limit test uses # of source chars now
The length limit test previously used the URL-encoded UTF-8 representation
of the source sentense. This was needed because of a fixed size buffer in C.
Now that the server is in Haskell, the only reason the length is limited
is to avoid excessive time and space use in the parser, so it is better to
count source characters. This also avoids being too restrictive with
non-European languages.
2015-04-16 12:21:32 +00:00
hallgren 3aaeaf1325 Translating linearization functions to Haskell: move Haskell AST and pretty printer to GF.Haskell
For further separation of pretty printing concerns from conversion concerns,
the Haskell AST and pretty printer has been moved to its own module,
GF.Haskell, also allowing it to be reused in other places where Haskell
code is generated.
2015-04-14 12:44:14 +00:00
hallgren 29712a43ac Wide coverage translation demo: show an informative error message for sentences that exceed the length limit 2015-04-09 10:18:41 +00:00
hallgren e2e943eabc GF.Compile.ConcreteToHaskell: some documentation 2015-04-07 14:51:52 +00:00
hallgren 33442e6b4f GF.CompileInParallel: get rid of the cryptic 'thread blocked indefinitely in an MVar operation' message after compilation errors
Instead show a message saying how many modules were affected by the compilation
errors.
2015-03-31 13:26:51 +00:00
hallgren bab4e7f872 translator/DictionarySwe.gf: nordic_A, washing_N 2015-03-31 12:24:54 +00:00
hallgren 4a195c1915 translator/DictionaryTha.gf: fix a syntax error 2015-03-25 14:32:37 +00:00
hallgren d1bca8f4de Wide Coverage Translation Demo: zoomable panable collapsible syntax trees
This is an experimental solution using JavaScript code from
https://github.com/christos-c/tree-viewer, d3js.org and jquery.com.
2015-03-24 18:03:10 +00:00
hallgren 40c431ec6c 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 a3183b07b0 translator/DictionarySwe.gf: add eclipse_N and eclipse_V2 2015-03-23 11:52:06 +00:00
hallgren fbd7e498cd Wide Coverage Translation Demo: add a way to obtain inflection tables
Too see inflection tables, click on a translated sentense, then click on a
blue function name in the textual representation of the abstract syntax tree.
2015-03-22 22:54:05 +00:00
hallgren de1437d3c4 Wide Coverage Translation Demo: draw abstract trees and parse trees
You can now click on a tree to toggle between the abstract syntax tree and
the parse tree.

Also, the implementation now uses the new C run-time requests, e.g.

	App14.pgf?command=c-abstrtree&tree=...

so no need to install AppEng.pgf on the server any more.
2015-03-19 15:26:18 +00:00
hallgren 374da1f0b0 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 fac915e783 haskell-bind: add bindings to graphviz rendering functions for abstract&parse trees 2015-03-19 14:14:30 +00:00
hallgren e92583ca8c Wide Coverage Translation Demo: draw syntax trees
The trees are drawn by using the Haskell run-time request 

	AppEng.pgf?command=abstrtree&tree=...

Thus AppEng.pgf has to be installed on the server and in sync with App14.pgf.
This is to avoid loading the huge App14.pgf in the Haskell run-time system, and
is enough since we only need the abstract syntax.
2015-03-18 16:23:04 +00:00
hallgren 9ce7b36024 translator/DictionarySwe.gf: some fixes and new words, e.g. neither7nor_DConj 2015-03-17 15:49:56 +00:00
hallgren dcf941d2be translation/DictionarySwe.gf: three new words
Ignoring suspicious entries latest_N, times_N and pend_V.
2015-03-16 15:22:03 +00:00
hallgren ae97390cf5 translator/DictionarySwe.gf: three new words and a gender correction 2015-03-16 14:14:14 +00:00
hallgren 7c1be91839 Fix -path directives for Mongolian
+ Remove references to alltenses.
+ Remove references to ../../prelude
+ Add missing reference to ../common in mongolian/SymbolMon.gf
2015-03-13 14:41:30 +00:00
hallgren 3502750052 GF.CompileInParallel: fix a Win32 problem
Recognize \ in addition to / when extracting path components.
2015-03-13 13:48:14 +00:00
hallgren 4ff30e6771 Wide Coverage Translation Demo: improved performance
For improved performance, request only one translation from the server
initially. When the user clicks on a translated sentense, request 9 more
translations.
2015-03-11 17:53:25 +00:00
hallgren 9efbe0e47a GF.Server: request logging: increase length limit from 100 500 chars per field 2015-03-11 15:56:06 +00:00
hallgren 82763282bb Simple Translation tool: add File menu command 'Open in Wide Coverage Translation Demo'
Just as a quick way to test different documents in the Wide Coverage
Translation Demo.
2015-03-06 12:04:17 +00:00
hallgren bc7500bd26 gf.cabal: increase idle time before full GC to 5 seconds
The builtin GHC RTS default is 0.3 seconds, which results in very bad
interactive behaviour when working with a large grammar in the GF shell.
2015-03-05 15:30:41 +00:00
hallgren 0ea372f230 GF.Compile.Compute.ConcreteNew: add dynamic table conversion
If the enumaration of table parameter values fails during the static
traversal phase, try again in the dynamic computation phase, when the values
of bound variables are known.

This is necessary to properly deal with generic table construction in opers,
like the ones found in prelude/Coordination.gf, e.g.

  consTable : (P : PType) -> ... = \P ... -> {s1 = table P {...} ; ... }
2015-03-04 18:20:16 +00:00
hallgren 31f6cbe9e0 GF.Compile.Compute.ConcreteNew: some refactoring for readability 2015-03-04 13:30:11 +00:00
hallgren cc014e659f Fix to avoid "error (no reason given) OCCURRED IN optimizing <cat>"
GF.Compile.Optimize.mkLinReference can fail and cause this error because
the helper function inside it applies msum to a list that might be empty
(if there is a record type that does not contain a field of type Str).
This means that it can return mzero::Err, i.e.

   Bad "error (no reason given)"

which can slip through the top level test that only catches Bad "no string".
2015-03-02 14:27:36 +00:00
hallgren 801582d27f GF shell: fixed problems with previous change of the -retain flag
Because the prompt included the name of the abstract syntax, the loading
of the PGF was forced even if -retain was used. Even worse,
if an error occured while loading the PGF, it was repeated and caught
every time the prompt was printed, creating an infite loop. The solution
is to not print the name of the abstract syntax when the grammar is
imported with -retain, which is the way things were before anyway.
2015-02-27 16:42:09 +00:00
hallgren d809c5db1e GF shell: create a PGF also when the -retain flag is used
The commands available in the shell after import -retain are now a superset
of the commands available after import without -retain.

The PGF is created lazily, so there should be no performance penalty if
the PGF isn't needed. If there are errors, they won't be reported until a
command that uses the PGF is entered.
2015-02-27 13:49:13 +00:00
hallgren eea4dfd2fa gf.cabal: adjust version constrains on the network, cgi and httpd-shed packages 2015-02-25 18:41:57 +00:00
hallgren 5cf0ab4110 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 83c5269a84 Wide Coverage Translation Demo: better resizing behavior on startup and when pasting text 2015-02-25 15:36:25 +00:00
hallgren 2d979aea4d translator/DictionarySwe.gf: 15 new words and a few fixes 2015-02-24 15:10:24 +00:00
hallgren 7631527395 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 3dc44ef8cf translator/DictionarySwe.gf: add oriented_A and simplify_V2 2015-02-23 16:39:54 +00:00
hallgren 08840a0afe translator/Dictionary.gf: remove video_A 2015-02-20 14:37:41 +00:00
hallgren 8d0bb75121 gftransate.js: increase sentence length limit for "fast" language to 500
Currently Bul, Chi, Eng and Swe are marked as "fast" in the documentation.
2015-02-20 14:34:37 +00:00
hallgren 25eeb7bb9c translator/Dictionary*.gf: remove video_A 2015-02-20 14:31:23 +00:00
hallgren 9dce1473d1 translator/DictionarySwe.gf: 6 new words
Found when translating a few paragraphs from a new article
2015-02-20 14:29:35 +00:00
hallgren 913e56081a gftranslate.js: reduce sentense length limit to 200 (URL encoded) characters
This limit might still be to high to avoid excessive time/space use in the
parser for certain languages in the wide coverage translation grammar.
2015-02-20 12:31:41 +00:00
hallgren b72b8dcef8 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
hallgren 4bd568d8bf Wide Coverage Translation Demo: use App14.pgf, remove spaces from Chi, Jpn and Tha output 2015-02-18 13:58:49 +00:00
hallgren 1dbe588497 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 2ce3e954fd 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 0058a79a8f PGF.Haskell: adding operators for selections from tables 2015-02-12 16:09:33 +00:00
hallgren 43a873b53f Translating linearization functions to Haskell: more simplifications
+ Some additional simplifying rewrites.
+ Use an intermediate representation for Haskell types, for separation of
  concerns and cleaner code.
+ Pretty printer layout tuning
+ Code cleanup.
2015-02-12 16:05:48 +00:00
hallgren 686f570660 Translating linearization functions to Haskell: simplify the generated Haskell code
Introduced an intermediate representation for the generated Haskell expressions.
This allows pretty printing concerns to be separated from conversion concerns,
and makes it easy to apply some simplifying rewrites to the generated
expressions, e.g.

	[x] ++ [y]    ==> [x,y]
	pure f <*> x  ==> f <$> x
	f <$> pure x  ==> pure (f x)
	join (pure x) ==> x
2015-02-11 23:50:19 +00:00
hallgren ad8b6429ec 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 28803ba322 Wide Coverage Translation Demo: use App13.pgf, adding support for Japanese
Japanese uses the same lexer as Chinese, i.e. every character is a separate
token.
2015-01-21 16:02:37 +00:00
hallgren ed502c490c PGF2: fixes for named entity callback function 2015-01-21 13:54:48 +00:00
hallgren 614f9f8663 examples/phrasebook/Makefile: include Jpn in 'make forApp' 2015-01-21 12:16:57 +00:00
hallgren ec8b4fec93 PGF2 & PGFService: enable callbacks for named entities and chunks in the c-parse & c-translate web requests 2015-01-21 10:41:12 +00:00
hallgren 7577de236f PGF2 & PGFService: work in progress on callbacks for nerc & chunks 2015-01-20 14:57:52 +00:00
hallgren 4372b47d2a PGF2: introduced some type synonyms to make type signature more readable 2015-01-20 12:57:33 +00:00
hallgren 240ba80209 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 fbed7c19d5 gf.cabal: include PGF.Haskell 2015-01-14 14:53:28 +00:00
hallgren 0b114195aa 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
hallgren 4348ae40d2 Translating linearization functions to Haskell: add support for pre {...}
STILL TODO:

	- variants
	- better treatment of special tokens BIND, SOFT_BIND & CAPIT.
2015-01-08 17:52:45 +00:00
hallgren 6db2845375 Translating linearization functions to Haskell: use qualified names to avoid name clashes
All languages in the Phasebook can now be converted to compilable Haskell
code.

STILL TODO:
  
  	- variants
  	- pre { ... }
2015-01-07 16:13:28 +00:00
hallgren 51a233b2f1 Translating linearization functions to Haskell: significant code size reductions
+ Instead of including lists of parameter values generated by GF, generate
  code to enumerate parameter values (in the same order as GF). This seems
  to give a factor of 2-3 code size reduction in the Phrasebook (e.g.
  from 84MB to 25MB for Hin, from 338MB to 154MB for Fre).

+ Deduplicate table entries, i.e. convert "table [..,E,..,E,..,E,..]" into
  "let x = E in table [..,x,..,x,..,x,..]". This gives even more significant
  code size reduction in some cases, e.g. from 569MB to 15MB for
  PhrasebookFin.

All phrasebook languages can now be converted to compilable Haskell code,
except PhrasebookPes, which still has the name clash problem.
2015-01-06 19:57:24 +00:00
hallgren 1f60646f41 More work on translating linearization functions to Haskell
Many Phrasebook languages can now be converted to compilable Haskell code.
Some languages (Fre, Hin, Snd, Urd) generate too much Haskell code to be
practically useful (e.g. 338MB for Fre). One language (Fin) took too long
to convert to Haskell. One language (Pes) has problems with name clashes in
the generated Haskell code.

STILL TODO:

  	- variants
  	- pre { ... }
  	- reduce code duplication for large tables
	- generate qualified names to avoid name clashes
2015-01-06 16:48:03 +00:00
hallgren 5da8b4b35e bin/build-binary-dist.sh: remove hardwired install path and version number
Also improved tolerance to paths containing white space.
2014-12-15 15:18:27 +00:00
hallgren 69e314eedc gf.cabal: include editor modes in the list of data files to install
Also add ghc-7.8.3 to the list of tested compiler versions
2014-12-15 15:16:50 +00:00
hallgren 80f814d1ab Setup.hs: compile Alltenses before Present
When mkPresent (or another preprocessor) is used, error messages from GF will
show the file name _gf_preproc.tmp instead of the name of the file where
the error occurred. By compiling Alltenses first, the real file name will
appear in error messages (unless the error only happens then mkPresent is
used).
2014-12-11 22:18:21 +00:00