1
0
forked from GitHub/gf-core

Compare commits

...

3394 Commits

Author SHA1 Message Date
krangelov
320ead943c Merge branch 'c-runtime' into compact-pgf 2019-09-20 14:08:30 +02:00
krangelov
c119d5e34b silence encoding error 2019-09-20 14:07:07 +02:00
krangelov
529635e0e9 Merge branch 'c-runtime' into compact-pgf 2019-09-20 11:22:15 +02:00
krangelov
a33a84df3d funnel the generated byte code to the runtime 2019-09-20 11:18:17 +02:00
krangelov
9e3512db81 Merge branch 'c-runtime' into compact-pgf 2019-09-20 10:55:23 +02:00
krangelov
8a419f66a6 Merge branch 'master' into c-runtime 2019-09-20 10:52:40 +02:00
krangelov
29662350dc removed more dead code 2019-09-20 10:49:29 +02:00
krangelov
a27bcb8092 Merge branch 'master' into c-runtime 2019-09-20 10:42:50 +02:00
krangelov
4d79aa8b19 remove obsolete code 2019-09-20 10:37:50 +02:00
krangelov
e989cc69a2 compute the parameter indices 2019-09-20 09:49:46 +02:00
krangelov
5c5af8df79 Merge branch 'c-runtime' into compact-pgf 2019-09-20 08:10:46 +02:00
krangelov
084b345663 added option to show the probabilities of results 2019-09-20 08:09:54 +02:00
krangelov
400aad1d07 Merge branch 'c-runtime' into compact-pgf 2019-09-20 07:19:47 +02:00
krangelov
a0cfe09e09 added option -number to limit the number of parse results 2019-09-20 07:18:58 +02:00
krangelov
12912299be added extra integer to store the offset of a parameter constructor 2019-09-19 22:53:07 +02:00
krangelov
b3c07d45b9 remove the old Haskell runtime 2019-09-19 22:40:40 +02: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
f12557acf8 remove the dependency to the Haskell runtime completely 2019-09-19 10:03:04 +02:00
Thomas Hallgren
9d3badd8b2 GrammarToCanonical: bug fix: add missing case for Empty 2019-09-10 12:41:16 +02:00
krangelov
e2ddea6c7d first version of a parser which returns chunks in case of failure 2019-08-30 13:31:57 +02:00
krangelov
59a6e3cfdd fix gu_map_next 2019-08-30 13:31:19 +02:00
krangelov
1e8d684f9a Merge branch 'master' of https://github.com/GrammaticalFramework/gf-core 2019-08-30 08:12:52 +02:00
krangelov
72cfc1f48a a more reasonable API to iterate over a map 2019-08-30 08:12:15 +02:00
John J. Camilleri
724bf67295 Update Stack files after testing with Stack v2
- Also bump up some minor GHC versions (8.4.3 -> 8.4.4, 8.6.2 -> 8.6.5)
- Should still work with Stack < v2 (tested in docker/haskell:8.2.2)
2019-08-28 10:57:21 +02:00
Thomas Hallgren
a7a592d93e Merge branch 'master' of https://github.com/GrammaticalFramework/gf-core 2019-08-21 14:33:30 +02:00
Thomas Hallgren
d1bb1de87f Minibar: support for links to open a given grammar in the minibar
When you press the "i" or "More info" button for a grammar, the info now
includes a link that can be used by anyone to open this specific grammar in
the minibar.
2019-08-21 14:27:56 +02:00
krangelov
394d033d19 added gu_map_delete 2019-08-20 18:55:36 +02:00
krangelov
cb678dfdc8 fix packages 2019-08-18 09:37:55 +02:00
krangelov
4161bbf0ec fix reference to FastCGIUtils 2019-08-18 09:12:30 +02:00
krangelov
148590927c remove obsolete code 2019-08-18 09:09:40 +02:00
krangelov
85a81ef741 Merge branch 'master' of https://github.com/GrammaticalFramework/gf-core 2019-08-09 15:18:27 +02:00
krangelov
3e662475ee bugfix in the parser's scanner 2019-08-09 15:15:30 +02:00
Thomas Hallgren
b77626b802 debian/rules: fix two build problems 2019-08-07 20:15:28 +02:00
Thomas Hallgren
12f2520b3c Download page: add binary package for Raspbian 10 2019-08-07 19:02:27 +02:00
Thomas Hallgren
941b4ddf1f GF home page: fix some links smoother operation over https 2019-08-07 14:07:47 +02:00
John J. Camilleri
85f12a5544 Remove wrong Haddock comment in PGF2
Clearly just a copy-paste error
2019-08-07 12:52:17 +02:00
Thomas Hallgren
81362ed7b7 Minibar can now display grammar documentation.
The documentation is taken from a file called Grammar.pgf_info, located
next to the Grammar.pgf file on the server.

The first line of the documentation is displayed below the menu bar in
the minibar. The rest of the documentation is displayed when you press
the "More info" button (or the "i" button).

The documentation can contain HTML markup. Blank lines are treated as
paragraph breaks.
2019-08-05 15:25:29 +02:00
John J. Camilleri
12079550f8 Remove TypeScript runtime and point to new repository
https://github.com/GrammaticalFramework/gf-typescript
2019-07-11 09:29:49 +02:00
John J. Camilleri
1ceb8c0342 Merge pull request #45 from GrammaticalFramework/pgf2json
Add export to PGF JSON format
2019-07-10 19:32:49 +02:00
John J. Camilleri
eab9fb88aa Minor renamings in JSON format 2019-07-10 08:49:00 +02:00
John J. Camilleri
acd4a5e8cd Address @heatherleaf's suggestions 2019-07-10 08:45:23 +02:00
John J. Camilleri
a4b1fb03aa Whitespace fixes 2019-07-07 17:38:07 +02:00
John J. Camilleri
cb88b56016 Finish compile to PGF JSON, including JSON schema for resulting format. 2019-07-07 17:35:31 +02:00
John J. Camilleri
ecf9b41db0 Finish JSON conversion for abstract 2019-07-03 16:34:07 +02:00
John J. Camilleri
c5a75c482c Start work on PGFtoJSON module. Add compiler flag -f json. 2019-07-03 15:07:31 +02:00
krangelov
32379a8d11 fully supported case-insensitive parsing/lookup 2019-06-30 08:48:23 +02:00
krangelov
b56591c6b6 the parser now ensures that all word senses are in the chart 2019-06-25 12:58:28 +02:00
krangelov
b94bb50ec9 fix in gu_buf_heap_pop 2019-06-24 12:27:36 +02:00
krangelov
e2395335cb Merge branch 'master' of https://github.com/GrammaticalFramework/gf-core 2019-06-24 12:14:15 +02:00
krangelov
2d9478b973 share some code for printing 2019-06-24 12:13:14 +02:00
John J. Camilleri
17e3f753fb gflib.ts: put warning on console when function undefined 2019-06-13 14:43:21 +02:00
John J. Camilleri
498ad572ac gflib.ts: fix in annotation when type is unknown 2019-06-13 14:12:53 +02:00
John J. Camilleri
bc61f8c191 gflib.ts: generate source map, which is helpful for debugging 2019-06-13 13:53:58 +02:00
John J. Camilleri
d252cfd610 gflib.ts: handled unimplemented functions during linearisation 2019-06-13 10:31:49 +02:00
John J. Camilleri
46a1bdc7ea gflib.ts: also accept U+00C0-U+00FF (\192-\255) in idents in parseTree
Matches definition in src/compiler/GF/Grammar/Lexer.x
2019-06-12 15:28:25 +02:00
John J. Camilleri
18d0e1fad0 gflb.ts: add comments about startsWith polyfill, making into module 2019-06-12 09:51:27 +02:00
John J. Camilleri
ab94e93b94 Avoid modifying String prototype in TypeScript runtime
Adds new class TaggedString
2019-06-10 11:39:31 +02:00
John J. Camilleri
a229507392 Use strict mode in TypeScript, catch some more corner cases 2019-06-10 11:14:14 +02:00
John J. Camilleri
6a9c917b29 TypeScript readme 2019-06-10 10:19:43 +02:00
John J. Camilleri
9ba4a42426 Add generated gflib.js under typescript/js. Add deprecation notice in javascript. 2019-06-10 10:15:03 +02:00
John J. Camilleri
bbd1c9147a Catch for when rules are undefined 2019-06-10 09:48:44 +02:00
John J. Camilleri
4793d376d9 Create copies when tagging
Not sure if this behaviour is identical to previous version,
or in truth how important it really is anyway
2019-06-10 09:45:04 +02:00
John J. Camilleri
63606fd2d0 Minor indentation fixes in gflib.js
Despite it being deprecated 🙈
2019-06-10 09:29:43 +02:00
John J. Camilleri
d6a1e87f4a Support for pre in gflib.ts. Some type annotation fixes. 2019-06-07 21:17:41 +02:00
John J. Camilleri
ffcdaa921f Porting of JS runtime to TypeScript (gflib.ts) complete 2019-06-07 13:58:23 +02:00
John J. Camilleri
f2e03bfc51 Remove type definitions gflib.d.ts which contained many errors and now obsolete 2019-06-07 10:07:23 +02:00
John J. Camilleri
c89656f3ee More type fixes in gflib.ts after setting noImplicitAny 2019-06-07 10:06:19 +02:00
John J. Camilleri
c9b4318e9e Clean up whitespace in [old] gflib.js 2019-06-07 09:34:13 +02:00
John J. Camilleri
1e43e7be4b Fix all type errs in gflib.ts except tagging ones. Add TS/eslint configs.
gflib.js required changing the String prototype which I'm not sure I want to do here
2019-06-07 09:33:24 +02:00
John J. Camilleri
44261b7582 More progress on gflib.ts
All code has been copied from gflib.js but there are many type errors
yet to be resolved
2019-06-05 10:23:27 +02:00
John J. Camilleri
b980bce334 Add gflib.ts, a port of JS runtime gflib.js into TypeScript (WIP) 2019-06-04 15:16:17 +02:00
John J. Camilleri
bd7753db1a Update TypeScript definitions for gflib.js
Still not 100% tested: best solution will really be to rewrite
gflib.js in TypeScript and at the same time use ES modules
2019-05-29 14:43:28 +02:00
krangelov
8c18d7162f bits of documentation 2019-05-28 12:59:07 +02:00
krangelov
ac039ec74f filter out empty cohorts 2019-05-28 12:42:59 +02:00
krangelov
9f0ea19a1c API for scanning for cohorts in an arbitrary text 2019-05-28 12:26:00 +02:00
krangelov
8df2121650 Merge branch 'master' of https://github.com/GrammaticalFramework/gf-core 2019-05-27 09:06:11 +02:00
krangelov
8b9719bd2d remove duplicate definition for RecordCompare 2019-05-27 09:05:41 +02:00
Aarne Ranta
b7249adf63 reordered error message for 'no overload'; might be even better to show complete types 2019-05-20 15:58:47 +02:00
John J. Camilleri
7a3efdfeb9 Update link to RGL tutorial (now HTML version) 2019-05-20 10:36:35 +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
John J. Camilleri
af62a99bf5 update_html rewrites anchors which Pandoc 1.16 doesn't process
See #43
2019-05-06 08:45:07 +02:00
John J. Camilleri
ac1f304722 Merge pull request #42 from gear0/master
corrected some minor typos in reference manual
2019-05-06 08:11:02 +02:00
gear0
92720b92a4 corrected some minor typos in reference manual 2019-05-05 12:09:31 +02:00
Inari Listenmaa
078440ffbf Merge pull request #41 from inariksit/js-doc
(doc) Update path to gflib.js
2019-05-03 18:54:06 +02:00
Inari Listenmaa
68919a5e42 (doc) Update path to gflib.js 2019-05-03 18:53:28 +02:00
Thomas Hallgren
a5a019a124 runtime/javascript: use a grammar.js with two langauges
grammar.js contained only one langauge: FoodsEng. Now it contains
FoodsEng and FoodsIta, similar to what's shown in the gf-tutorial.
The grammar comes from gf-contrib/tutorial/foods.
2019-05-03 15:19:19 +02:00
Thomas Hallgren
61fe167392 gf-tutorial: fix link to JavaScript translator demo
After fixing trivial problem in translator.html, the demo works, but
the example grammar contains only one langauge, so it is not so
interesting. translator.html is located in src/runtime/javascript.
The editor.html in the same location also works.
2019-05-03 14:52:28 +02:00
Aarne Ranta
fd29925173 started collecting error messages in order to explain them 2019-04-29 16:53:43 +02:00
Thomas Hallgren
bea6aa1d2d GF.Compile.CheckGrammar: discard bad 'lincat C = …' with a warning
e.g. if C is a fun and not a cat in the abstract syntax.
Discarding bad lincats prevents GF from generating malformed PGFs that
are rejected by the C run-time system.
I also added code to reject bad lincats with an error, but I left it
commented out since it seems a bit pedantic compared to GF's otherwise
rather sloppy grammar checking.
2019-04-25 17:02:42 +02:00
krangelov
c628e11c01 respect the probs option also when merging PGFs 2019-04-12 11:04:40 +02:00
Thomas Hallgren
61e7df4d1c Fix outdated comment about which version of the Haskell Platform to use 2019-04-05 16:38:12 +02:00
krangelov
de53a7c4db Merge branch 'master' of https://github.com/GrammaticalFramework/gf-core 2019-03-26 12:21:52 +01:00
krangelov
1e9188ea60 bugfix in the pretty printer 2019-03-26 12:21:35 +01:00
Thomas Hallgren
a55c7c7889 GF.Compile.GrammarToCanonical: keep unreachable rows in tables
since unreachable rows can become reachable after grammar transformation.
Also export smart constructors for projection and selection.
2019-03-22 15:38:02 +01:00
Aarne Ranta
b3387e80e4 hiding morphological tags from Latex printing of dependency trees 2019-03-20 22:19:32 +01:00
Thomas Hallgren
de0a997fcd Merge branch 'master' of https://github.com/GrammaticalFramework/gf-core 2019-03-20 14:40:17 +01:00
Thomas Hallgren
0f53431221 GF.Grammar.Canonical: pretty printer: omit some redundant brackets 2019-03-20 14:39:42 +01:00
krangelov
099f2de5b4 support cross-compilation from Linux to Windows 2019-03-19 12:43:38 +01:00
krangelov
2f2b39c5d2 Merge branch 'master' of https://github.com/GrammaticalFramework/gf-core 2019-03-19 11:22:09 +01:00
krangelov
f3d7d55752 added one more possible location for Java headers 2019-03-19 11:21:39 +01:00
Thomas Hallgren
2979864752 GF.Compile.GrammarToCanonical: allow + in reg exps in pre { } 2019-03-14 16:52:37 +01:00
Thomas Hallgren
b11d7d93dc GF.Grammar.Canonical: some Functor/Foldable/Traversable instances 2019-03-13 01:51:26 +01:00
Thomas Hallgren
ba9aeb3322 Merge branch 'master' of https://github.com/GrammaticalFramework/gf-core 2019-03-12 22:34:00 +01:00
Thomas Hallgren
8e2424af49 GF.Grammar.Canonical: add TuplePattern and CommentedValue 2019-03-12 22:32:54 +01:00
Peter Ljunglöf
01b9e8da8d canonical GF: flatten several concatenations into one json array, and parse the array back into concatenations 2019-03-08 18:33:56 +01:00
Peter Ljunglöf
926a5cf414 added parsing of json into canonical GF 2019-03-08 17:58:24 +01:00
Peter Ljunglöf
21140fc0c0 remove case expressions (no particular reason) 2019-03-08 17:57:02 +01:00
Peter Ljunglöf
3328279120 corrected json printing
some object labels must be preceded by ".", to not be in conflict with GF records (which are stored as json objects)
plus some minor bugfixes and cleaning
2019-03-08 17:35:35 +01:00
Peter Ljunglöf
8cf4446e8c Remove "canonical_yaml" from the option descriptions 2019-03-08 17:21:23 +01:00
Thomas Hallgren
5b401f3880 Expose GF.Grammar.Canonical + some refactoring
to make it available in other tools by depending on the gf package and
importing it
2019-03-07 17:41:16 +01:00
Thomas Hallgren
b783299b73 Rename module GF.Compile.ConcreteToCanonical to GF.Compile.GrammarToCanonical 2019-03-07 14:47:37 +01:00
Thomas Hallgren
0970d678cf haskell-bind/utils.c: add missing return
Found via C compiler warning
2019-03-07 14:11:29 +01:00
Thomas Hallgren
bf17fa0bb2 Bump version number to 3.10.3-git
This is not an announced realase, but this is version now installed on our
server.
2019-03-05 20:18:30 +01:00
Thomas Hallgren
0b3c278f49 Merge branch 'master' of https://github.com/GrammaticalFramework/gf-core 2019-03-05 19:23:54 +01:00
Thomas Hallgren
c710bf0e84 Update .deb packages to verion 3.10-2 on the download page
New .deb packages have been generated since it turned out that the
RGL was missing in original .deb packages.
2019-03-05 19:18:45 +01:00
Thomas Hallgren
eb46577f58 debian/rules bug fix: the RGL was not included in .deb packages
The problem was that the RGL was both built and copied to the destdir
during the build step, which caused it to be deleted before the install
step. It is now copied to destdir during the install step.
2019-03-05 16:19:46 +01:00
krangelov
52f2739da1 strip empty phrases in bracketedLinearize 2019-02-27 08:27:50 +01:00
krangelov
fc37bc26cd fixed typo on c-bracketedLinearize 2019-02-26 21:10:06 +01:00
krangelov
bde1a6d586 fix the dependency to json 2019-02-26 19:32:08 +01:00
krangelov
25dc934871 replace aeson with json 2019-02-26 19:27:36 +01:00
krangelov
2fdfef13d8 added command c-bracketedLinearize 2019-02-26 15:16:36 +01:00
Thomas Hallgren
a928e4657e Need aeson>=1.3
Also remove ununsed GF.Compile.PGFtoAbstract
2019-02-21 14:43:53 +01:00
Thomas H
b6fd9a7744 Merge pull request #34 from heatherleaf/master
Encode/decode of canonical grammars to/from JSON/YAML
2019-02-21 14:26:11 +01:00
krangelov
64a2483b12 added Data.Data.Data instance for Expr 2019-02-20 13:00:51 +01:00
krangelov
1d1e65185a fixes in the headers for use with Microsoft Visual C++ 2019-02-18 11:39:21 +01:00
krangelov
c32cd7133f fixes in the headers for compilation on Windows 2019-02-18 11:23:01 +01:00
krangelov
409731413e disable the parser debugger which was left enabled by accident 2019-02-14 15:33:21 +01:00
krangelov
8a5e7fa25d fix the reader for patterns in a def rule 2019-02-14 15:32:12 +01:00
krangelov
e05c79a751 different definition for GF_ARRAY_LEN 2019-02-14 15:31:36 +01:00
krangelov
ef21d08225 bugfix in computing record lengths 2019-02-14 15:29:33 +01:00
Peter Ljunglöf
f8346c4557 added helper info about canonical grammar output 2019-02-08 09:22:08 +01:00
Peter Ljunglöf
47ac01e4b9 enable export of canonical grammars to JSON and YAML 2019-02-08 09:10:48 +01:00
Peter Ljunglöf
a0c1da2548 encoding/decoding canonical GF grammars to/from JSON and YAML 2019-02-08 09:10:04 +01:00
Thomas Hallgren
951b884118 Export of concrete syntax to Haskell now goes via Canonical GF
TODO: better treatment of Predef functions and record subtyping coercions
2019-01-23 02:47:10 +01:00
Thomas Hallgren
fc5c2b5a22 PGF.Haskell.fromStr: fix double spaces caused by empty tokens 2019-01-23 02:45:23 +01:00
Thomas Hallgren
e4abff7725 More work on the canonica_gf export
+ Abstract syntax now is converted directly from the Grammar and not via PGF,
  so you can use `gf -batch -no-pmcfg -f canonical_gf ...`, to export to
  canonical_gf while skipping PMCFG and PGF file generation completely.
+ Flags that are normally copied to PGF files are now included in the
  caninical_gf output as well (in particular the startcat flag).
2019-01-22 17:16:32 +01:00
Thomas Hallgren
a40130ddc4 gfse: prevent scrolling during drag-and-drop on iOS
Applies to webkit-based browsers on other touch-based platforms too
2019-01-21 21:18:01 +01:00
Thomas Hallgren
71307d6518 Two fixes in GF.Grammar.Canonical
+ Hide Prelude.<> to avoid ambiguity with ghc-8.6
+ Vertical alternative in the pretty printer for table types A => B
2019-01-18 14:44:45 +01:00
Thomas Hallgren
fc1b51aa95 Adding -output-format canonical_gf
This output format converts a GF grammar to a "canonical" GF grammar. A
canonical GF grammar consists of

 - one self-contained module for the abstract syntax
 - one self-contained module per concrete syntax

The concrete syntax modules contain param, lincat and lin definitions,
everything else has been eliminated by the partial evaluator, including
references to resource library modules and functors. Record types
and tables are retained.

The -output-format canonical_gf option writes canonical GF grammars to a
subdirectory "canonical/". The canonical GF grammars are written as
normal GF ".gf" source files, which can be compiled with GF in the normal way.

The translation to canonical form goes via an AST for canonical GF grammars,
defined in GF.Grammar.Canonical. This is a simple, self-contained format that
doesn't cover everyting in GF (e.g. omitting dependent types and HOAS), but it
is complete enough to translate the Foods and Phrasebook grammars found in
gf-contrib. The AST is based on the GF grammar "GFCanonical" presented here:

  https://github.com/GrammaticalFramework/gf-core/issues/30#issuecomment-453556553

The translation of concrete syntax to canonical form is based on the
previously existing translation of concrete syntax to Haskell, implemented
in module GF.Compile.ConcreteToHaskell. This module could now be reimplemented
and simplified significantly by going via the canonical format. Perhaps exports
to other output formats could benefit by going via the canonical format too.

There is also the possibility of completing the GFCanonical grammar
mentioned above and using GF itself to convert canonical GF grammars to
other formats...
2019-01-17 21:04:08 +01:00
Thomas Hallgren
5fe963dd02 Fix compilation with ghc-7.10
NoMonadFailDesugaring is not supported by ghc-7.10, but it is only needed
with ghc>=8.6
2019-01-16 14:42:34 +01:00
John J. Camilleri
f32d222e71 Update links to Haskell docs on homepage 2019-01-10 08:58:34 +01:00
Prasanth Kolachina
a131b244df Merge pull request #25 from pkolachi/master
add CoNLLU as output format for gf2ud: merging issue (#24)
2019-01-07 13:26:44 +01:00
Prasanth Kolachina
0accd97691 add CoNLLU as output format for gf2ud: merging issue (#24) 2019-01-07 13:24:49 +01:00
Prasanth Kolachina
f8bd35543c Merge pull request #24 from odanoburu/gf2ud-comments
(gf2ud) add comments to CoNLL-U output
2019-01-07 13:18:45 +01:00
John J. Camilleri
a7b10ea936 Change refs from RGL's Make.* to Setup.* in dev guide 2018-12-22 13:59:32 +01:00
Krasimir Angelov
7c97e5566d fix after the change in bracketed string 2018-12-20 12:40:46 +01:00
Krasimir Angelov
7288425daf Merge branch 'master' of https://github.com/GrammaticalFramework/gf-core 2018-12-20 10:55:56 +01:00
Krasimir Angelov
260c0d07e0 revert to printing the unique id in ppBracketedString 2018-12-20 10:54:04 +01:00
Krasimir Angelov
26dabeab9b save the original concrete category in BracketedString 2018-12-20 10:52:45 +01:00
odanoburu
f7c2fb8a7d (gf2ud) add comments to CoNLL-U output
when debbuging labels, I find it useful to have comments saying what's
the original sentence (lazy, I know) and the original tree (depending
on the treebank, the trees can be similar).

I know this is not the goal exactly, but UDv2 treebanks
(http://universaldependencies.org/format.html) should always have a
'text =' comment, and a 'sent_id =' comment (which would be easy to
implement too, but not that useful).
2018-12-19 12:13:31 -02:00
John J. Camilleri
4bda53acb7 Update PGF API link to point to 3.9, as 3.10 has no docs on Hackage 2018-12-18 22:14:32 +01:00
Aarne Ranta
54204d2d95 added the possibility to annotate features of syncat words, e.g. @"is" PresSg3 2018-12-18 18:44:02 +01:00
Aarne Ranta
9834b89a30 refactored cnc configfile parsing a bit 2018-12-18 18:30:40 +01:00
Aarne Ranta
b3a2b53df2 Merge pull request #22 from pkolachi/master
fix conll output in gf2ud and allow comments in dependency configs
2018-12-18 19:06:25 +02:00
Aarne Ranta
77c0a8e100 Merge branch 'master' into master 2018-12-18 19:05:42 +02:00
Prasanth Kolachina
86233e9c28 morph. feat generation by AR 2018-12-18 16:53:35 +01:00
Aarne Ranta
40e7544a2b added morphological tags to UD tree output. Tags are give in CncConfiguration, e.g. @N Sg Pl. Default tag is Cat-offset, as defined for each Cat in pgf 2018-12-18 15:59:48 +01:00
Prasanth Kolachina
61c1510620 allow comments in dependency configs and fix conll output 2018-12-17 12:02:13 +01:00
krangelov
eb22112178 a pool where the smallest chunks are memory pages 2018-12-16 07:46:14 +01:00
John J. Camilleri
083aa96e57 TOC for Markdown should now work for both Pandoc < 2.0 and >= 2.0
The use of $toc$ and $table-of-contents$ flags changed, see:
https://pandoc.org/releases.html#pandoc-2.0-29-oct-2017
under "Behaviour changes"
2018-12-10 14:25:44 +01:00
John J. Camilleri
d82a53ebc6 Replace gf-refman.html with Markdown version gf-refman.md
The raw HTML was invalid, and this way we use the common website template
for a uniform look without any duplication.

It seems gf-refman.html was once generated from txt2tags, although I have
been unable to find this original .t2t file.
I also tried to re-generate txt2tags from HTML but was not able to.
However I was able to convert HTML to Markdown using Pandoc and I think
the result is pretty good, so I think we should use this.

The original gf-refman.html can be obtained from git history, e.g.:
a7e43d872f/doc/gf-refman.html
2018-12-09 20:38:02 +01:00
John J. Camilleri
5006b520d1 Area under footer is all gray even on short pages 2018-12-08 14:29:43 +01:00
John J. Camilleri
f78dfe80a2 Update doc/index page 2018-12-08 14:29:02 +01:00
John J. Camilleri
44ac326da0 Regnerate HTML if template changes 2018-12-08 13:57:04 +01:00
John J. Camilleri
a8b23d52a8 Fix some invalid HTML. 2018-12-08 13:47:27 +01:00
John J. Camilleri
d880a61857 Add some documentation to update_html 2018-12-06 13:47:50 +01:00
John J. Camilleri
7bd086ba19 Case-insensitve sed replacements handled the dumb way
Because BSD sed != GNU sed
2018-12-06 10:18:31 +01:00
John J. Camilleri
ff0fe0a6c5 Add reference to DG in homepage footer. Spacing in top links. 2018-12-06 09:30:49 +01:00
John J. Camilleri
ef4df27d1b Add link to open #gf in web chat 2018-12-06 09:13:52 +01:00
John J. Camilleri
e9e2bd6b89 Fix linking to chapters in gf-tutorial; Remove reference to Htmls. 2018-12-06 09:00:44 +01:00
John J. Camilleri
72a9eb0c8a Another fake change to trigger rebuild of gf-tutorial 2018-12-05 18:14:17 +01:00
John J. Camilleri
b73f033b08 Rewrite <a name=...> to <div id=...> to preserve page anchors in Pandoc 2018-12-05 16:11:33 +01:00
John J. Camilleri
b974c09951 Update runtime-api.html to match the new visual look of the GF website 2018-12-05 15:48:07 +01:00
John J. Camilleri
159b6ee331 Fake change to trigger rebuild of gf-tutorial 2018-12-05 11:41:41 +01:00
John J. Camilleri
3dec78c21c Clarifications on download page: binary packages include RGL 2018-12-05 08:30:25 +01:00
John J. Camilleri
6ad9bf3dbf Add Stack files for different GHC versions 2018-12-04 10:32:26 +01:00
John J. Camilleri
ee5ac81dfc Make GF compile with GHC 8.6.2
- Re-implement `Distribution.Simple.BuildPaths.exeExtension`
- Turn off `MonadFailDesugaring`

Tested with GHC:

- 7.10.3
- 8.0.2
- 8.2.2
- 8.4.3
- 8.6.2

Yay Stack!
2018-12-04 10:31:53 +01:00
Thomas Hallgren
1a842efeaf downloads: add .deb package for Ubuntu (32-bit) 2018-12-03 16:10:01 +01:00
Thomas Hallgren
de005b9df3 Merge branch 'master' of https://github.com/GrammaticalFramework/gf-core 2018-12-03 15:53:36 +01:00
Thomas Hallgren
52bc0f566e debian/control: new dependency: pandoc
This should have been added before the 3.10 release
2018-12-03 15:52:52 +01:00
John J. Camilleri
b509d08cbf Add Travis build images to release notes 2018-12-03 15:47:45 +01:00
John J. Camilleri
fd0ee2756a Indent nested lists in Markdown by 4 spaces instead of 2 2018-12-03 15:44:44 +01:00
John J. Camilleri
34e89ac710 Put GF logo on the right again 2018-12-03 15:27:55 +01:00
John J. Camilleri
331d73b566 Update release notes RGL section (not much) 2018-12-03 15:25:05 +01:00
John J. Camilleri
8d460ac402 Update 3.10 release notes after going through all gf-core commits since 2017-08-11 2018-12-03 15:04:21 +01:00
John J. Camilleri
5546c6d6da Update clean_html to handle markdown sources too 2018-12-03 10:49:37 +01:00
John J. Camilleri
c380288db8 Put floating logo on left 2018-12-03 10:49:15 +01:00
Thomas Hallgren
bd7bb9b34a Merge branch 'master' of https://github.com/GrammaticalFramework/gf-core 2018-12-03 01:34:49 +01:00
Thomas Hallgren
18251e57a3 debian/changelog: updated release date 2018-12-03 01:33:52 +01:00
Thomas Hallgren
d06539c35c Merge branch 'master' of https://github.com/GrammaticalFramework/gf-core 2018-12-02 21:21:18 +01:00
Thomas Hallgren
60738dda6d gf.cabal: update tested-with 2018-12-02 21:20:54 +01:00
John J. Camilleri
e628e3fe0f Add news item for 3.10 release 2018-12-02 21:18:38 +01:00
Thomas Hallgren
769743c5c0 Minor fixes on the GF 3.10 download page 2018-12-02 15:29:55 +01:00
Thomas Hallgren
1c75d417ee Move 3.10 download page into place, update release date 2018-12-02 15:08:40 +01:00
John J. Camilleri
5c518de0f2 Updates to download page for 3.10 2018-12-01 19:52:33 +01:00
Thomas Hallgren
e6c2c844e9 GF.Main: leave the code page unchanged on Windows
This should make it easier to use GF with UTF-8 in the Windows Console
See https://groups.google.com/forum/#!topic/gf-dev/DCou6FDhCnU
2018-12-01 15:53:58 +01:00
Thomas Hallgren
883a7a95a1 build-binary-dist.sh: make it easy to choose which version of ghc to use 2018-12-01 15:53:27 +01:00
Aarne Ranta
831252eb81 dealing with ',' as syncategorematic token 2018-12-01 09:32:22 +01:00
Krasimir Angelov
fdc5659f80 Merge pull request #19 from MUSTE-Project/master
Fix deprecations from containers >= 0.4.0.0
2018-11-30 12:18:24 +01:00
Peter Ljunglöf
4d34c7f66b Fix deprecations from containers >= 0.4.0.0
E.g. `foldWithKey` has been deprecated since 0.4.0.0 (November 2010)[1] and has been removed in 0.6.0.1 (2018)[2]

[1]: https://github.com/haskell/containers/blob/master/changelog.md#0400--nov-2010
[2]: https://github.com/haskell/containers/blob/master/changelog.md#death-of-deprecated-functions

(commit originally by @fredefox)
2018-11-30 11:52:56 +01:00
Krasimir Angelov
f898c250ba removed instructions which doesn't actually work 2018-11-30 11:05:59 +01:00
Thomas Hallgren
5ef390f188 Merge branch 'master' of https://github.com/GrammaticalFramework/gf-core 2018-11-30 00:47:10 +01:00
Thomas Hallgren
fa5c6a2949 Fix spelling mistake on GF 3.9 download page 2018-11-30 00:46:24 +01:00
Thomas Hallgren
d0bc368358 Update make deb for the GF 3.10 release
This includes adding commands in debian/rules to build and include
the RGL and the example grammars in the debian package.
2018-11-30 00:17:45 +01:00
Thomas Hallgren
e0dca729d6 WebSetup.hs: don't output messages that lie about what's being installed 2018-11-30 00:15:37 +01:00
Thomas Hallgren
47c983c625 gf.cabal: remove redundant dependency on old-locale 2018-11-29 23:06:30 +01:00
John J. Camilleri
01f61c526f Custom CSS comes after libraries; add include-before/after (not actively used) 2018-11-29 13:06:52 +01:00
John J. Camilleri
538fe5bddb Don't wrap dates on hompage 2018-11-29 13:00:26 +01:00
John J. Camilleri
f4052c8a5e Add basic favicon.ico 2018-11-29 10:46:33 +01:00
John J. Camilleri
e0a3b0030e Remove some t2t frontmatter from shell-reference, to trigger update 2018-11-29 10:45:54 +01:00
John J. Camilleri
b30456aa0c Rename _template.html to template.html 2018-11-29 10:35:43 +01:00
John J. Camilleri
61c58316ea Remove overflow-x:scroll from title 2018-11-29 10:16:32 +01:00
John J. Camilleri
001d036a2c Remove t2t frontmatter from gf-editor-modes
Trying to force a rebuild
2018-11-29 09:55:28 +01:00
John J. Camilleri
fe7d01f7e3 Minors in footer 2018-11-28 22:34:04 +01:00
John J. Camilleri
a7e43d872f Merge branch 'new-website' 2018-11-28 22:22:41 +01:00
John J. Camilleri
d6fc50b40b Hide release announcement from homepage news 2018-11-28 22:21:56 +01:00
John J. Camilleri
9e02319b6d Better responsiveness, homepage and footer 2018-11-28 22:14:58 +01:00
John J. Camilleri
6278deb7a2 Page uses available width better, no jumping margins 2018-11-28 21:51:16 +01:00
Aarne Ranta
c6ec8cf302 fixed a bug in the cnclabel format 2018-11-28 19:56:47 +01:00
John J. Camilleri
07768ba4c4 Revert "Completely remove uses of example-based"
This reverts commit 69cea20dac.
2018-11-28 19:23:05 +01:00
John J. Camilleri
e2401f32ca Revert "remove the example-based folder. The code is still in the archive"
This reverts commit 05c2cfb628.
2018-11-28 19:22:19 +01:00
John J. Camilleri
69cea20dac Completely remove uses of example-based 2018-11-28 18:09:56 +01:00
Thomas Hallgren
32ce03dc94 bin/build-binary-dist.sh: include the RGL in binary distributions
TODO: the corresponding changes in debian/rules
2018-11-28 17:27:29 +01:00
John J. Camilleri
83abaa9b44 Put 3.9 page instead of 3.10 until release is final 2018-11-28 15:52:20 +01:00
John J. Camilleri
c7a14537c1 Update top links and footer during hackathon 2018-11-28 15:42:11 +01:00
Krasimir Angelov
8560b4fb65 Merge branch 'master' of https://github.com/GrammaticalFramework/gf-core 2018-11-28 15:33:24 +01:00
Krasimir Angelov
b0c3aef6ec add a few missing special tokens to the reference 2018-11-28 15:32:43 +01:00
John J. Camilleri
6352799ccb Merge branch 'master' into new-website
# Conflicts:
#	index.html
2018-11-28 14:47:20 +01:00
John J. Camilleri
a45c735545 Update LICENSE 2018-11-28 14:40:36 +01:00
Krasimir Angelov
05c2cfb628 remove the example-based folder. The code is still in the archive 2018-11-28 14:34:15 +01:00
Krasimir Angelov
69ad1e617e Merge branch 'master' of https://github.com/GrammaticalFramework/gf-core 2018-11-28 14:25:53 +01:00
Krasimir Angelov
eb2774af2b remove two obsolete options 2018-11-28 14:25:29 +01:00
John J. Camilleri
9b28d21b0a Remove Htmls.hs 2018-11-28 13:48:40 +01:00
John J. Camilleri
507236fdcd remove gf-server.cabal 2018-11-28 13:40:16 +01:00
John J. Camilleri
397f18a298 remove custom-binary flag; update Cabal version restriction; bump version to 3.10 2018-11-28 13:36:11 +01:00
John J. Camilleri
b1611eccd8 Make refman look up-to-date ish 2018-11-27 23:27:16 +01:00
John J. Camilleri
c8eb1010c5 Remove faq. Update people page. Add SS to news. 2018-11-27 23:12:21 +01:00
John J. Camilleri
14d35c8a31 Various fixes & cleanup in doc/ folder 2018-11-27 22:51:44 +01:00
John J. Camilleri
9bf5c98509 Work on new download page. Change 18-12 to 4.0.0 2018-11-27 22:36:57 +01:00
John J. Camilleri
8821f8baa8 Check all historic download and release pages 2018-11-27 22:14:01 +01:00
John J. Camilleri
8a45d23d63 Minors to homepage 2018-11-27 21:58:19 +01:00
Krasimir Angelov
abf3911b70 expose PGF and Concr for FFI 2018-11-27 21:09:35 +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
John J. Camilleri
cb0e919bf5 Link to new synopsis page 2018-11-13 21:22:54 +01:00
John J. Camilleri
d1a435ad9d Remove unnecessary CSS from template 2018-11-09 09:08:59 +01:00
John J. Camilleri
69ba677136 Add 3 top buttons, responsive columns 2018-11-09 08:40:06 +01:00
John J. Camilleri
406eec6690 GF logo links to home; remove "other demos" 2018-11-08 22:52:08 +01:00
John J. Camilleri
2f1ee094d2 Add download/index.md as demo of working Markdown rendering to HTML
Archive 3.9 pages and mark current ones for 18-12
2018-11-08 22:46:30 +01:00
John J. Camilleri
422248f11f Move unused pgf-binary into its own repository, at:
https://github.com/GrammaticalFramework/pgf-binary
2018-11-07 10:07:20 +01:00
John J. Camilleri
d46682bc29 Clean up stack file
Removed alex/happy as build-deps, if needed they can be installed with
`stack install alex happy`
2018-11-07 09:57:45 +01:00
Thomas Hallgren
8596fc5d26 Revert CSS change that produces overlapping text instead of responsive layout 2018-11-06 23:49:06 +01:00
John J. Camilleri
4958aab518 Add happy and alex as deps in Stack file 2018-11-05 09:59:06 +01:00
John J. Camilleri
390a6a04a1 New update_html runx txt2tags followed by pandoc
TODO: handle txt2tags macros in date, e.g.
`%%mtime(%F)` in download/encoding-change.t2t
2018-11-04 21:17:20 +01:00
John J. Camilleri
37e0754cf0 Fix encoding on tutorial 2018-11-04 21:12:32 +01:00
John J. Camilleri
a7b2f77227 Cleanup links in homepage and footer 2018-11-04 21:12:10 +01:00
John J. Camilleri
9a7862ea9e Links in footer 2018-11-04 19:58:18 +01:00
John J. Camilleri
914d54255f Comments in update_html script 2018-11-04 19:29:56 +01:00
John J. Camilleri
aea8548930 update_html also takes individual arguments 2018-11-04 19:27:14 +01:00
John J. Camilleri
99dad48961 Use Pandoc instead of txt2tags binary, much more configurable 2018-11-04 15:11:35 +01:00
John J. Camilleri
0b4d9cbea1 Add note about using Stack in download/index 2018-11-03 14:34:26 +01:00
John J. Camilleri
1010b9e49a Add stack file, using image for GHC 8.2.2 2018-11-03 14:28:31 +01:00
Krasimir Angelov
6a5053daeb move the PGF optimizer in the compiler 2018-11-02 14:48:30 +01:00
Krasimir Angelov
5a2b200948 manually copy the "c-runtime" branch from the old repository. 2018-11-02 14:38:44 +01:00
John J. Camilleri
f7dc9a6eaf Merge branch 'master' into new-website 2018-11-02 14:07:00 +01:00
Krasimir Angelov
bf5abe2948 the compiler and the Haskell runtime now support abstract senses 2018-11-02 14:01:54 +01:00
John J. Camilleri
777028dcd8 Remove doc/tutorial/gf-tutorial.html from version control
Checked that the t2t is still valid and html should be automatically
generated. Although there is some encoding issue with this file?
2018-10-31 15:57:21 +01:00
John J. Camilleri
7867c8c828 pre and post HTML templates for all txt2tags conversions
Remaining: cleaning of t2t files (remove unnecessary options)
2018-10-31 15:47:12 +01:00
John J. Camilleri
632cd1e522 Refresh home page using basic Bootstrap 2018-10-31 14:13:05 +01:00
John J. Camilleri
4387b1bea0 Add more phony's to Makefile 2018-10-31 13:14:06 +01:00
Inari Listenmaa
0a62c13fd1 Merge pull request #10 from inariksit/master
Add {-# LANGUAGE GADTs -#} to the generated Haskell file
2018-10-19 16:23:16 +02:00
Inari Listenmaa
8c382b3cb1 Add {-# LANGUAGE GADTs -#} to the generated Haskell file 2018-10-19 15:20:05 +02:00
Thomas Hallgren
effa818408 gf -cshell bug fix
The functions cExpr and hsExpr in GF.Command.Commands2 need to
handle string literals.
2018-10-16 16:23:54 +02:00
John J. Camilleri
8df3b458d4 cabal sdist doesn't throw an error anymore
This was making it impossible to install gf as external source in cabal sandbox
2018-10-15 21:05:55 +02:00
Krasimir Angelov
a0afbfbad3 Merge branch 'master' of https://github.com/GrammaticalFramework/gf-core 2018-10-15 12:04:36 +02:00
Krasimir Angelov
8a9430f63a hide the compatibility API 2018-10-15 12:04:03 +02:00
Thomas Hallgren
6b1e21508e Comment out links to some old demos that no longer work 2018-10-10 14:22:24 +02:00
Aarne Ranta
8787b56def option rf -paragraphs 2018-09-21 10:40:39 +02:00
John J. Camilleri
50e1e7b17e Merge pull request #7 from odanoburu/travis-ci
add travis ci
2018-08-13 08:46:09 +02:00
John J. Camilleri
f1803a2f16 Small fixes to gf-developers document 2018-08-12 21:30:11 +02:00
odanoburu
64ccc424cf (#5) rm files from nix build 2018-08-11 22:44:45 -03:00
odanoburu
dce81dc0ec (#5) reintroduce make install 2018-08-11 22:16:28 -03:00
odanoburu
29acef41fc (#5) specify image version 2018-08-11 22:11:27 -03:00
odanoburu
4038546321 (#5) no need for make install 2018-08-11 22:07:53 -03:00
odanoburu
df31ab241b (#5) add travis CI with docker
dependencies are preinstalled in docker image for faster build, but this means we need to update it whenever dependencies change
2018-08-11 22:02:08 -03:00
John J. Camilleri
35304c8577 Remove Travis build status from homepage 2018-08-08 22:33:20 +02:00
John J. Camilleri
3b7aaaf9f4 Add news item to homepage about repo split 2018-08-08 09:08:50 +02:00
Thomas H
e89e5f13bf Merge pull request #3 from MUSTE-Project/master
A version of `readPGF` where the user can handle reading files
2018-08-06 16:31:55 +02:00
Frederik Hanghøj Iversen
6b2c2256d1 A version of readPGF where the user handles the IO. 2018-08-06 16:05:12 +02:00
Thomas Hallgren
d9f0dfd400 gf.cabal: expose GF.Text.Lexing, needed by gf-server.cabal 2018-07-31 15:02:59 +02: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
John J. Camilleri
dfb3914881 Update README 2018-07-26 21:42:06 +02:00
John J. Camilleri
636a8142b4 Minimal update with new repo URLs & build instructions 2018-07-26 01:37:03 +02:00
John J. Camilleri
59e66adb35 Fixes for buildWeb 2018-07-26 00:51:13 +02:00
John J. Camilleri
e1dd7bfdf5 [GF Split] Post-split updates 2018-07-25 19:55:11 +02:00
John J. Camilleri
895b479564 Merge pull request #8 from legalese/GF_LIB_PATH
GF_LIB_PATH can now be path1:path2:path3, not just 1path
2018-07-22 14:48:44 +02:00
Meng Weng Wong
7f86bee8e7 explain that GF_LIB_PATH can now be a colon-separated list 2018-07-22 00:14:29 -07:00
meng wong
8a14912ee3 GF_LIB_PATH can now be path1:path2:path3, not just path1
Traditionally, GF_LIB_PATH points to something like
`.../share/ghc-8.0.2-x86_64/gf-3.9/lib`

and if you want prelude and alltenses and present, you add a
`--# -path=.:present`
compiler pragma to the top of your .gf file

But if you are developing some kind of application grammar
library or contrib of your own, you might find yourself
repeating your library path at the top of all your .gf files.

After painstakingly maintaining the same library path at the
top of all your .gf files, you might say, let's factor this
out into GF_LIB_PATH.

Then you might then find to your surprise that GF_LIB_PATH
doesn't accept the usual colon:separated:path notation
familiar from, say, unix PATH and MANPATH.

This patch allows you to define
`GF_LIB_PATH=gf-3.9.lib:$HOME/gf-contrib/whatever/lib`
in a more natural way.

If you are an RGL hacker and have your own version of the
RGL tree sitting somewhere, you should be able to have both
paths in the GF_LIB_PATH, for added convenience. This minor
convenience will probably lead to obscure bugs and great
frustration when you find that your changes are mysteriously
not being picked up by GF; so keep this in mind and use it
cautiously.

This caution should probably sit in the documentation
somewhere. A subsequent commit will do that.

If you use zsh, you can do this to quickly build up a big
GF_LIB_PATH:

% gf_lib_path=( $HOME/src/GF/lib/src/{api,abstract,common,english,api/libraryBrowser,prelude,..} )

% typeset -xT GF_LIB_PATH gf_lib_path
2018-07-22 00:04:07 -07:00
John J. Camilleri
cd1942a845 WebSetup: fail silently when example grammars don't build
Also used installed RGL not built
2018-07-19 12:36:39 +02:00
John J. Camilleri
6a8d0038ed Merge pull request #46 from odanoburu/construct
(Eng) use Extend instead of Extra in Construction
2018-07-17 16:32:36 +02:00
John J. Camilleri
f9331526d1 More cleanup in Setup and WebSetup 2018-07-05 15:22:05 +02:00
John J. Camilleri
8b5532c1e9 Relax dependency on directory package for Setup
Since `listDirectory` is no longer used (852a49920)
2018-07-05 14:21:05 +02:00
Krasimir Angelov
73cf58da23 revert to a version compatible with Cabal 1.22 2018-07-05 13:10:02 +02:00
Krasimir Angelov
e95aa16fdc Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2018-07-05 13:01:46 +02:00
John J. Camilleri
0ef7fb8b0f Cleanup in Setup.hs; include custom-setup:setup-depends in cabal file. 2018-07-05 12:23:02 +02:00
John J. Camilleri
992af4ab97 Clean up imports in Setup.hs
Really just for my own understanding
2018-07-05 10:32:40 +02:00
Krasimir Angelov
ce83d8490b Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2018-07-05 09:13:04 +02:00
John J. Camilleri
af82dc9fc6 Fix make sdist to use git archive instead of darcs dist 2018-07-04 14:28:25 +02:00
John J. Camilleri
a6b1db71cd Remove more remnants from the darcs days 2018-07-04 14:21:44 +02:00
John J. Camilleri
40cc58d6c1 Replace Distribution.Simple.Utils.noticeNoWrap with putStr
Effect is the same and I don't want to upset the package dependencies
2018-07-04 14:00:56 +02:00
John J. Camilleri
b9b0217160 Remove code which tries to get version information from darcs folder 2018-07-04 13:40:46 +02:00
Krasimir Angelov
f64b17eef7 Merge branch 'master' of https://github.com/GrammaticalFramework/GF
Conflicts:
	examples/phrasebook/SentencesBul.gf
	examples/phrasebook/WordsBul.gf
2018-07-04 13:09:39 +02:00
Krasimir Angelov
7bfd6199d6 a majour refactoring to support clitic pronouns 2018-07-04 13:01:06 +02:00
John J. Camilleri
c6f4edaea5 Remove examples directory; these now live in gf-contrib
All changes have been reflected in the gf-contrib repository:
https://github.com/GrammaticalFramework/gf-contrib

Now, for WebSetup to build the example grammars, one must have gf-contrib
cloned in the same top-level directory as GF. When this isn't the case,
WebSetup displays a notice without failing.
2018-07-04 10:09:58 +02:00
Krasimir Angelov
00476ae386 Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2018-06-27 20:52:59 +02:00
Thomas Hallgren
23961ef0b3 GF.Server: add 'import Control.Applicative' for compatibilit with GHC<7.10
One could also add stricter version constraints in gf.cabal, e.g.
base>=4.8 (implies GHC>=7.10) if we want to only support building with
GHC>=7.10.
2018-06-27 17:40:35 +02:00
Krasimir Angelov
97da247d21 Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2018-06-27 11:54:24 +02:00
Krasimir Angelov
6c4c22ff7a undo the partial fix for word completion since it breaks normal parsing 2018-06-27 11:53:40 +02:00
Krasimir Angelov
5afaa39c19 Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2018-06-23 22:47:32 +02:00
Inari Listenmaa
73cc57c7e0 Merge pull request #64 from odanoburu/por
(Por) add more preposition cases and CountNP
2018-06-21 14:16:58 +02:00
Krasimir Angelov
68db7695f5 a simple fix for the linearizer 2018-06-20 22:21:10 +02:00
Krasimir Angelov
b86373438b Revert "when linearizing missing functions with brackets, the name of the function should still be reported"
This reverts commit 18204bdd25bd460904ac475f3ea340daa96589df.
2018-06-20 21:16:19 +02:00
Krasimir Angelov
4cdd4dd8a7 Revert "forgot to switch off the debugger"
This reverts commit 5919dfa3366dfd2f2af8c3ce7749d066a2033f0d.
2018-06-20 21:13:58 +02:00
odanoburu
f067267953 Merge remote-tracking branch 'upstream/master' into por 2018-06-20 12:33:05 -03:00
Krasimir Angelov
427f8d8478 forgot to switch off the debugger 2018-06-20 16:36:45 +02:00
Krasimir Angelov
aaefe4310d when linearizing missing functions with brackets, the name of the function should still be reported 2018-06-20 16:35:28 +02:00
Krasimir Angelov
65cfdf1775 added bracketedLinearizeAll 2018-06-20 13:51:41 +02:00
Krasimir Angelov
d8eac259e4 Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2018-06-20 13:06:15 +02:00
Krasimir Angelov
09d576f5b4 bracketedLinearize in Haskell now emits the BIND constructor like in Java 2018-06-20 13:05:15 +02:00
John J. Camilleri
485938103c Remove wide coverage translator
It had now been migrated to a new repository:
https://github.com/GrammaticalFramework/wide-coverage
2018-06-20 10:06:22 +02:00
John J. Camilleri
6ce57c0505 Homepage minors
- add Travis build status icon
- make Github link point to org rather than repo
2018-06-20 09:55:53 +02:00
Krasimir Angelov
96f3484622 Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2018-06-16 07:09:17 +02:00
Inari Listenmaa
9d2b92dbc1 Split gftest to a new repo 2018-06-15 14:31:21 +02:00
Inari Listenmaa
2d9240e036 Merge pull request #62 from inariksit/dutch
Small fixes in Dutch
2018-06-15 14:05:06 +02:00
Inari Listenmaa
92d9e20f19 (Dut) Extend vs. Extra 2018-06-15 13:14:53 +02:00
John J. Camilleri
71c7fbc7f9 Remove oldstyle.css 2018-06-14 10:11:11 +02:00
John J. Camilleri
f0c5d53e78 Remove editor mode files from Haskell package (in gf.cabal) 2018-06-13 10:18:25 +02:00
John J. Camilleri
4ca52bf763 Add TypeScript type definitions for gflib.js 2018-06-13 09:52:20 +02:00
John J. Camilleri
22b754d23b Clean up old download pages 2018-06-13 08:47:33 +02:00
Aarne Ranta
013f3573e6 added transliteration arabic_unvocalized, which omits the vowels 2018-06-12 20:39:39 +02:00
John J. Camilleri
5aa2a212bb Remove HTML files from VC which should be generated from txt2tags
If these pages disappear from the web via www.grammaticalframework.org
then this commit may need to be reversed
2018-06-12 15:53:58 +02:00
John J. Camilleri
27b49e0a8b Remove /framenet redirect for the sake of cleaning things up 2018-06-12 15:43:28 +02:00
John J. Camilleri
d0ce46722b Minor cleanup in webpages 2018-06-12 15:41:05 +02:00
Inari Listenmaa
baa74e7b32 Merge pull request #59 from inariksit/gftest
(gftest) Fixes/additions when comparing against older version
2018-06-12 14:53:06 +02:00
Inari Listenmaa
df6c9e047e (gftest) Compare also functions of arity 0 + custom startcat for comparison 2018-06-12 14:35:03 +02:00
John J. Camilleri
e969948a47 Remove .authorspellings (it was a darcs relic and now useless) 2018-06-11 22:10:32 +02:00
John J. Camilleri
ffb74b2f3d Merge branch 'master' of github.com:GrammaticalFramework/GF 2018-06-09 20:44:24 +02:00
odanoburu
8b05ed9469 Merge remote-tracking branch 'upstream/master' into por 2018-06-06 09:51:42 -03:00
Inari Listenmaa
54be69f2b8 Merge pull request #55 from inariksit/dutch
Dutch smart paradigms + remove commented out code
2018-06-05 11:50:24 +02:00
Inari Listenmaa
cc0d4426a2 Merge pull request #54 from odanoburu/master
* update GF mode
2018-06-05 11:38:16 +02:00
odanoburu
9a17ca21b5 * update GF mode
- moved to new repo at
  https://github.com/GrammaticalFramework/gf-emacs-mode
- main changes:
  - use utf-8 encoding for inferior gf process
  - add display of operation types
- update links
2018-06-04 09:16:02 -03:00
Krasimir Angelov
10e10298d9 implemented compound nounds which work like adverbs 2018-05-30 23:04:40 +02:00
odanoburu
92d476f43b Merge remote-tracking branch 'upstream/master' into por 2018-05-28 16:22:54 -03:00
Krasimir Angelov
44e387ec16 Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2018-05-28 10:14:27 +02:00
Krasimir Angelov
e862968305 added comment for Windows 2018-05-28 10:14:03 +02:00
Krasimir Angelov
4c5fc9f3a8 some tweaks for Windows 2018-05-28 10:12:27 +02:00
Inari Listenmaa
1e71e18e21 (gftest) Add --show-context + combine -o with -f,-c,-b
Added a few new features:

    -o OldGrammar.pgf: if combined with -f , -c or -b , only test the specified trees+functions.
    --show-context FId: shows contexts for the particular concrete category
    --show-cats interacts with --debug by showing also concrete categories
2018-05-24 23:40:11 +01:00
Inari Listenmaa
a2f9d9d8d5 Merge pull request #52 from odanoburu/doc-pre
(refman) update pre syntax
2018-05-24 23:10:17 +01:00
Inari Listenmaa
a0849d8a5a (gftest) Add --show-context + combine -o with -f,-c,-b 2018-05-24 22:36:23 +02:00
odanoburu
2ae44902e1 (refman) update pre syntax [ci skip] 2018-05-24 13:50:23 +00:00
Prasanth Kolachina
19c6090e85 Merge pull request #50 from pkolachi/master
function for linearizing variants (bracketedStringAll)
2018-05-24 09:52:48 +02:00
Prasanth Kolachina
ef4731e8ba spell error in py.egs.README 2018-05-24 09:47:55 +02:00
Prasanth Kolachina
6faad1b3cf add bracketLinearizeAll for variants 2018-05-24 09:47:27 +02:00
odanoburu
d205679dce (Por) merge PRs #45 and #48 and solve conflicts 2018-05-23 19:07:32 -03:00
odanoburu
b3c6bfa8d2 Merge branch 'por-extra' into por-merge 2018-05-23 19:03:58 -03:00
odanoburu
c8b1cb715e Merge remote-tracking branch 'upstream/master' into por 2018-05-23 11:22:46 -03:00
Inari Listenmaa
10df5a7269 (gftest) Multiple concrete categories for context generation 2018-05-22 11:49:42 +01:00
Inari Listenmaa
b635cb3d52 (gftest) Better pruning + add new command line option 2018-05-21 18:41:16 +01:00
Krasimir Angelov
9d39648dfb fixed typo which broke the compilation on Windows 2018-05-21 16:03:30 +02:00
Krasimir Angelov
e6ae55641f Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2018-05-21 09:37:33 +02:00
Krasimir Angelov
a6779486c5 fix the compilation when the byte order cannot be detected statically 2018-05-21 09:36:39 +02:00
John J. Camilleri
41af91f697 Update info about path to jni.h in Java binding install notes 2018-05-21 09:14:26 +02:00
John J. Camilleri
ba4057b214 Missing -I in Java bindings Makefile 2018-05-21 09:10:19 +02:00
Inari Listenmaa
1c7e99cdca Merge pull request #37 from mbrock/master
Fix the Nix build
2018-05-04 17:23:53 +02:00
Mikael Brockman
42bcb50154 Fix the Nix build
We use the Nix "jailbreak" function to ignore the upper bounds
on the CGI package dependency.
2018-05-04 14:08:08 +03:00
John J. Camilleri
bb5b21b925 Rename README to README.md 2018-05-03 11:03:56 +02:00
John J. Camilleri
260d5251da Markdownise README and add Travis build icon 2018-05-03 10:49:05 +02:00
John J. Camilleri
eabaa54a23 Merge pull request #14 from mbrock/master
Add a Travis configuration for checking that new commits build correctly
2018-05-03 10:41:59 +02:00
Inari Listenmaa
fc61f97a7a (PhrasebookEst) Fix nationality adj. for Polish 2018-05-01 10:42:29 +02:00
Inari Listenmaa
ece39a8879 Estonian Phrasebook: '<Nationality> restaurant' and 'NN is <Nationality>' use different forms 2018-04-30 16:38:20 +02:00
Inari Listenmaa
a0fc1dfddd Merge pull request #34 from odanoburu/refman
remove reference to lexer and unlexer flags from documentation
2018-04-22 09:24:55 +02:00
odanoburu
87ddb34a3d - fix typo
- rm link to Wiki that seems dead
2018-04-21 20:09:48 -03:00
odanoburu
9064c3d7cd rm references of lexer and unlexer flags from reference manual 2018-04-21 20:09:40 -03:00
Inari Listenmaa
295896190d Make documentation about -split-pgf clearer 2018-04-18 20:54:27 +02:00
Thomas Hallgren
6f707461e1 gf.cabal: use -fhide-source-paths
if ghc>=8.2
2018-04-18 19:30:03 +02:00
Thomas Hallgren
820d2d503f Fixes for GHC 8.4.1 compatibility
* In GHC 8.4.1, the operator <> has become a method of the Semigroup class
  and is exported from the Prelude. This is unfortunate, since <> is also
  exported from the standard library module Text.PrettyPrint, so in any
  module that defines a pretty printer, there is likely to be an ambiguity.

  This affects ~18 modules in GF. Solution:

    import Prelude hiding (<>)

  This works also in older versions of GHC, since GHC does't complain if
  you hide something that doesn't exists.

* In GHC 8.4.1, Semigroup has become a superclass of Monoid. This means
  that anywhere you define an instance of the Monoid class you also have to
  define an instance in the Semigroup class.

  This affects Data.Binary.Builder in GF. Solution: conditionally define
  a Semigroup instance if compiling with base>=4.11 (ghc>=8.4.1)
2018-04-18 19:18:10 +02:00
Inari Listenmaa
fea68d0a88 Merge pull request #31 from odanoburu/por
update Por
2018-04-16 09:00:00 +02:00
odanoburu
2127e74228 merge and rm conflict 2018-04-14 19:22:50 -03:00
odanoburu
7d89d0b442 Merge remote-tracking branch 'upstream/master' into por 2018-04-14 19:22:01 -03:00
Krasimir Angelov
2036ffe06d bugfix in the Haskell binding 2018-04-12 15:12:36 +02:00
Krasimir Angelov
9a6b3b4a1f Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2018-04-12 14:45:30 +02:00
Krasimir Angelov
2d898e78c0 bugfix in the C parser 2018-04-12 14:45:02 +02:00
Inari Listenmaa
4931acc36d Merge pull request #30 from odanoburu/master
small fixes
2018-04-10 08:37:10 +02:00
odanoburu
2c163bb243 - rm duplicate lines 2018-04-09 12:14:32 -03:00
odanoburu
d7154a52f9 - rm trailing spaces 2018-04-09 12:14:02 -03:00
odanoburu
69a1944293 Merge remote-tracking branch 'origin/por' into por 2018-04-09 12:10:33 -03:00
odanoburu
92b15a337e rm duplicate lines 2018-04-09 12:09:45 -03:00
Inari Listenmaa
fcdcb23b35 Add more helpful printouts if no grammar provided 2018-04-06 16:55:41 +02:00
Inari Listenmaa
b9d0012f6b Add a tool to generate test cases for GF grammars 2018-04-06 16:32:58 +02:00
Inari Listenmaa
99db3945c1 Merge pull request #28 from odanoburu/por
WIP: Portuguese resource grammar
2018-04-03 11:41:28 +02:00
odanoburu
b4c64cb81b - add Por to complete languages (although it's not quite there yet)
- update headers
- add Por modules to lib/src/api/
2018-03-29 20:17:39 -03:00
Thomas Hallgren
3d6a5e8864 gfse: show grammar comments in the list of public grammars
gf -server now includes the comment field from the grammar in the
response to /cloud requests with command=ls-t and ext=.json
2018-03-29 18:23:32 +02:00
Thomas Hallgren
750a1349ff gfse: allow public grammars to be deleted in more cases
The editor doesn't show delete buttons on grammars published by other
users, but it was too picky when deciding which grammars you own. Now
it should be possible to delete grammars from the device/browser
you published it from, even if you don't have a private copy of it any more.

On a related note, there seems to be problem with the way unique grammars
names are created and maintained, causing published grammars to be duplicated
in some cases. This needs to be overhauled.
2018-03-29 17:02:22 +02:00
odanoburu
a59c0ffeee Merge remote-tracking branch 'upstream/master' into por 2018-03-29 11:49:19 -03:00
Thomas Hallgren
78cf184957 gfse: fix for some browser: hovering over an empty grammar comment to edit it
This was a problem in Safari (an other similar browsers I presume), but
not in Firefox: hovering over the grammar comment (shown below the grammar
name when you edit a grammar) didn't reveal the button to edit it, thus
preventing you from adding a comment. It was till possible by selecting the
"Enable editing on touch devices." at the bottom of the screen, but most
people probably didn't notice that it is possible to add a comment.
2018-03-29 16:17:25 +02:00
Thomas Hallgren
a9135c9b7e Merge branch 'master' of www.grammaticalframework.org:/usr/local/www/GF 2018-03-29 14:56:07 +02:00
Thomas Hallgren
31ef32a815 gfse: sort list of public grammars by age, by default
There is also a menu so you can choose to sort the list by name or by age
2018-03-29 14:54:42 +02:00
Krasimir Angelov
bb4218433f - tweak the tokenizer in pgf_lookup_sentence to threat .!?,: as separate tokens
+ bugfix which causes crashes
2018-02-22 11:35:54 +01:00
Krasimir Angelov
a16fe3415a partial fix for word completion in the C runtime 2018-02-04 17:21:15 +01:00
Thomas Hallgren
6cc95f664e index.html: update summer school link 2018-01-29 11:28:11 +01:00
Thomas Hallgren
725b518d5c demos/index.html: add link to multilingual_headlines.html
It was lost in the move from darcs to GIT, since it was added
with a local change and not recorded in the darcs repository.
2018-01-23 15:58:28 +01:00
Thomas Hallgren
5164951e23 Remove "Warning: default encoding has changed from Latin-1 to UTF-8"
The warning is about a change that was made in GF 3.6 (June 2014) and has
probably outlived its purpose by now.
2018-01-23 14:55:33 +01:00
Aarne Ranta
96adbebca8 some paradigm extensions 2018-01-21 12:18:15 +01:00
Inari Listenmaa
ebe317c864 Merge pull request #25 from GrammaticalFramework/basque
Some more fixes / updates on the Basque RG
2017-12-28 13:25:26 +02:00
Inari Listenmaa
ced0bff5c7 Merge remote-tracking branch 'origin/master' into basque 2017-12-28 13:20:44 +02:00
Inari Listenmaa
e2ec40a22f Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2017-12-20 10:27:23 +01:00
Krasimir Angelov
6e66c6ff1b Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2017-12-19 10:48:11 +01:00
Krasimir Angelov
a7926835a3 bugfix for random generation with HOAS 2017-12-19 10:47:30 +01:00
Krasimir Angelov
fa8530add1 silence some warnings on MINGW32 2017-12-09 23:11:04 +01:00
Krasimir Angelov
4a1d19086a added one more include to define alloca for Windows 2017-12-09 23:06:34 +01:00
Krasimir Angelov
515ea697ba Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2017-12-09 23:05:32 +01:00
Krasimir Angelov
7260d5496d fix the compilation of sqlite3Btree.c on Windows 2017-12-09 23:04:34 +01:00
Aarne Ranta
79feeaf5b8 new option linerize -tabtreebank for tab-separated treebank generation 2017-12-06 17:37:12 +01:00
John J. Camilleri
98db9a257f Update editor modes page for Atom 2017-12-06 10:35:28 +01:00
John J. Camilleri
2da722d930 Add cabal sandbox files to .gitignore 2017-11-27 09:50:51 +01:00
Aarne Ranta
a7e7d8d83c year of 3.9 release corrected 2017-10-06 15:38:41 +02:00
Krasimir Angelov
0bb6b5968e temporaryly fix GF.Command.Commands2 2017-10-05 21:09:38 +02:00
Inari Listenmaa
ef1b67356d Merge remote-tracking branch 'origin/master' into basque 2017-10-05 10:05:52 +02:00
Inari Listenmaa
1e3272b00e Merge remote-tracking branch 'origin/master' into basque 2017-10-04 15:01:36 +02:00
Krasimir Angelov
e3aa392e63 further extend the API of the C runtime 2017-10-04 09:45:56 +02:00
Krasimir Angelov
e426e87cf8 in the PGF2 api: remove showCategory. add categoryContext and functionIsConstructor 2017-10-03 16:05:01 +02:00
Krasimir Angelov
8eef0b5376 GF.Compile.Instructions is obsolete and now removed 2017-09-29 16:52:56 +02:00
Krasimir Angelov
f2bc7ec7b6 added exprSubstitute in the C runtime for substituting meta variables 2017-09-28 16:33:34 +02:00
Krasimir Angelov
1c04fa4897 the parser for abstract expressions in the C runtime now supports partial parses 2017-09-28 13:57:13 +02:00
Krasimir Angelov
06ec6b3e92 added a method in Python for pretty printing a grammar 2017-09-26 09:16:48 +02:00
Krasimir Angelov
404154d16b added showPGF in the Haskell API 2017-09-25 18:31:36 +02:00
Krasimir Angelov
d79ac56870 handle productions in the internal creation API 2017-09-25 13:23:53 +02:00
Krasimir Angelov
d103fe6755 make pgf_production_is_lexical public since it will be needed in the Haskell binding 2017-09-25 12:20:48 +02:00
Krasimir Angelov
5f39d062b7 fix typo in jni_utils.c 2017-09-25 10:53:05 +02:00
Krasimir Angelov
9c781c7b24 fix the compilation of jsg.c after the last patch 2017-09-25 10:41:15 +02:00
Krasimir Angelov
66c20b1996 handle BIND & CAPIT in bracketedLinearize for Java 2017-09-25 10:36:38 +02:00
Krasimir Angelov
91728a3a98 Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2017-09-18 21:56:07 +02:00
Krasimir Angelov
b3d96cfa93 added Expr.size() in the Java binding 2017-09-18 21:55:10 +02:00
Krasimir Angelov
7ae5ef0a35 add writer.c in Android.mk 2017-09-15 10:32:06 +02:00
Krasimir Angelov
6eb1f8e14c Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2017-09-14 18:12:32 +02:00
Krasimir Angelov
bcb97a336e make the API for indexing in the parser and the linearizer public since it will be needed in the Haskell binding 2017-09-14 18:11:24 +02:00
Krasimir Angelov
0d42eed7b6 Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2017-09-14 15:24:02 +02:00
Krasimir Angelov
d574bb2164 an almost complete API for building new PGF files in the Haskell binding 2017-09-14 15:23:13 +02:00
Krasimir Angelov
1ff8dd88e8 fix gu_encode_double 2017-09-13 17:20:00 +02:00
Krasimir Angelov
febf01a9be corrections in the PGF writer 2017-09-13 14:05:26 +02:00
Krasimir Angelov
80b61f716c added PGF2.Internal.writePGF in the Haskell binding 2017-09-13 10:32:39 +02:00
Krasimir Angelov
df992c31fd added gu_out_u16be, gu_out_u64be and gu_out_f64be in libgu. The later is using gu_encode_double which is probably still wrong. Corrected gu_in_le and gu_in_f64be. 2017-09-13 10:23:28 +02:00
Krasimir Angelov
3e55aa4424 added function pgf_write 2017-09-13 09:30:52 +02:00
Krasimir Angelov
09e5278690 added PGF writer to the C runtime 2017-09-13 09:23:55 +02:00
Krasimir Angelov
3aecefebdb an almost complete API for creating the abstract syntax of a PGF in memory 2017-09-11 14:12:36 +02:00
Krasimir Angelov
6712969503 an API to access the grammar's flags 2017-09-11 08:50:29 +02:00
Krasimir Angelov
09f5c95d82 more type corrections 2017-09-08 23:45:33 +02:00
Krasimir Angelov
31b5e550b7 the Haskell binding should be more careful with the matching types in C 2017-09-08 23:21:40 +02:00
Krasimir Angelov
527d97fdd2 fix the type signatures for the linearizer callbacks 2017-09-08 22:58:42 +02:00
Krasimir Angelov
71e6562eaa an initial sketch for PGF building API in the Haskell binding 2017-09-08 15:15:23 +02:00
Krasimir Angelov
16172be940 the C runtime should also install data.h in order to make it possible to access the internal structures 2017-09-07 21:34:39 +02:00
Krasimir Angelov
4f680b728b a light API in the Haskell binding for accessing the internal data structures 2017-09-07 21:31:33 +02:00
Krasimir Angelov
60bd12a952 the experimental export to Lambda Prolog is now obsolete and is removed 2017-09-07 14:01:46 +02:00
Thomas Hallgren
9f7a6cfe10 PGF2.FFI: import Data.Word(Word)
for compatibility with older versions of GHC
2017-09-06 18:01:08 +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
301b100988 word completion in the C parser now returns information about the function which generates the token 2017-09-06 14:37:51 +02:00
Krasimir Angelov
ef071d9157 Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2017-09-06 12:40:22 +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
Aarne Ranta
8005aee378 in Haskell GADT generation, hide Tree in the import of PGF 2017-09-06 10:51:43 +02:00
Krasimir Angelov
18f2135785 added function printName in the Haskell binding 2017-09-05 11:56:53 +02:00
Krasimir Angelov
0469f4e97a added languageCode in the Haskell binding 2017-09-05 10:57:40 +02:00
Krasimir Angelov
c3297dd2e9 update documentation for command pt 2017-09-05 10:33:53 +02:00
Krasimir Angelov
01a8e1b88f GF.Command.TreeOperations is now independent from the runtime's internals 2017-09-05 10:29:02 +02:00
Krasimir Angelov
13d8045814 added exprSize and exprFunctions in the Haskell runtime too and use them in TreeOperations 2017-09-05 10:16:48 +02:00
Krasimir Angelov
5ed0e3ae7f fix the type signature for exprSize 2017-09-05 10:08:55 +02:00
Krasimir Angelov
30b7ba04c7 added exprFunctions in the Haskell binding 2017-09-05 10:07:43 +02:00
Krasimir Angelov
85cf2d9f5a added exprSize in the Haskell binding 2017-09-05 09:50:29 +02:00
Krasimir Angelov
a5fe5b9378 added exprHash in the Haskell binding 2017-09-05 09:46:43 +02:00
Mikael Brockman
5c73d6d7a9 Add a Travis configuration for autotesting commits
The configuration uses Nix to install dependencies.  I first tried using
just Cabal, but compiling all the dependencies takes too long for the
free tier of Travis.  Nix doesn't compile Hackage dependencies because
it has a "binary cache" with compiled versions of almost all
Hackage packages.

I do not run the GF test suite, because it seems to be in a
failing state.  This can be enabled later.

All of this will only be enabled once the Travis service is set up by
someone in the GF team with the permissions to do so.

Build results will then be automatically visible on all new commits and
pull requests.
2017-09-04 19:22:07 +03:00
Krasimir Angelov
08d781833c forgot to commit PGF2.FFI 2017-09-04 14:58:59 +02:00
Krasimir Angelov
08d7997d05 Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2017-09-04 14:53:53 +02:00
Krasimir Angelov
71c4b4a246 instance Eq Expr in the Haskell binding 2017-09-04 14:49:44 +02:00
Krasimir Angelov
da091824a3 pt -paraphrase was never properly implemented and is now removed 2017-09-04 13:11:17 +02:00
Krasimir Angelov
74ae6bb89e Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2017-09-04 11:45:40 +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
cae52bb9af added a separate cabal file for the Haskell runtime 2017-09-04 09:57:25 +02:00
Krasimir Angelov
4fe9f88128 move the custom Binary package back to src/runtime/haskell 2017-09-04 09:55:17 +02:00
Krasimir Angelov
bbdbf2bc5d silence Tab warnings in the Haskell runtime 2017-09-01 14:31:08 +02:00
Krasimir Angelov
c48f3bdfbc rename the pgf2-bind package to pgf2 2017-09-01 13:07:47 +02:00
Thomas Hallgren
2b52ff1f73 Merge https://github.com/GrammaticalFramework/GF 2017-09-01 11:02:02 +02:00
Krasimir Angelov
e214a00ed3 added command "rt" in the C shell 2017-09-01 10:40:12 +02:00
Krasimir Angelov
5c38482e56 the C shell now type checks expressions before they are used 2017-09-01 10:19:36 +02:00
Krasimir Angelov
8a333c9ca8 bugfix in showType from the C runtime 2017-09-01 10:00:47 +02:00
Krasimir Angelov
d5a7945ba0 complete details for the "ai" command in the C shell 2017-09-01 09:57:00 +02:00
Aarne Ranta
37a1f65f86 added aligner.c to Android.mk 2017-09-01 09:32:28 +02:00
Krasimir Angelov
1a27ddfabb fix the Android makefile after the addition of word alignment API 2017-09-01 09:19:37 +02:00
Krasimir Angelov
5a37660811 added function treeProbability in the Haskell binding 2017-09-01 08:46:52 +02:00
Krasimir Angelov
1182a9b63d giza alignment in the C shell 2017-09-01 08:23:12 +02:00
Krasimir Angelov
983e804223 update documentation for Haskell 2017-09-01 08:11:16 +02:00
Krasimir Angelov
b9c04fd612 graphvizWordAlignment in the C runtime 2017-08-31 13:03:11 +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
Krasimir Angelov
675ef4573c remove move dead code in the C shell 2017-08-31 08:12:18 +02:00
Krasimir Angelov
16828fb91e some dead code elimination 2017-08-30 20:42:04 +02:00
Krasimir Angelov
070d00a20c an almost complete ai command in the C shell 2017-08-30 19:44:10 +02:00
Krasimir Angelov
13a854d349 implement rf in the C shell 2017-08-30 19:19:10 +02:00
Krasimir Angelov
34294bf36e pg in the C shell now supports most output formats 2017-08-30 19:04:29 +02:00
Krasimir Angelov
cd53269f96 bugfix for hasLinearization in the Haskell binding 2017-08-30 18:11:59 +02:00
Krasimir Angelov
fd56b4b5f3 remove some dead code in the C shell 2017-08-30 16:56:00 +02:00
Krasimir Angelov
ccf9227c05 in the C shell rename the ga command to gt to be consistent with the standard shell 2017-08-30 16:40:25 +02:00
Krasimir Angelov
137a06586a "lc" was a temporary hack and is now removed from the C shell 2017-08-30 16:36:57 +02:00
Krasimir Angelov
7db9f51d78 "ma" command in the C shell 2017-08-30 16:35:57 +02:00
Krasimir Angelov
4a24bc98f2 the l command in the C shell now supports the same options as in the normal shell 2017-08-30 16:18:26 +02:00
Krasimir Angelov
75efcbd280 added tabularLinearizeAll in the Haskell binding 2017-08-30 16:18:07 +02:00
Krasimir Angelov
08a728799a change tabularLinearize in the Haskell binding to return a list instead of map this preserves the order 2017-08-30 15:59:43 +02:00
Krasimir Angelov
97fe5df267 added the concreteName function in the Haskell binding 2017-08-30 15:43:09 +02:00
Krasimir Angelov
19613a76ab document embedding in C# 2017-08-30 11:22:32 +02:00
Krasimir Angelov
dd8a9ed587 Embedded grammars in C# 2017-08-30 11:18:03 +02:00
Krasimir Angelov
14f1fedfe4 document FunctionType in C# 2017-08-30 09:19:53 +02:00
Krasimir Angelov
170c38bb58 for consistency PGF.FunctionByCategory is renamed to PGF.FunctionsByCat 2017-08-30 09:15:23 +02:00
Krasimir Angelov
8a50d851c3 Updated C# documentation 2017-08-30 09:09:45 +02:00
Krasimir Angelov
bb5b5ca73b added graphvizAbstractTree and graphvizParseTree in Java 2017-08-30 08:33:16 +02:00
Krasimir Angelov
890e03527b added checkExpr in Java 2017-08-30 08:23:58 +02:00
Krasimir Angelov
d92f8f2f9e added readType in Java 2017-08-30 08:15:59 +02:00
Krasimir Angelov
3e9de6ffbb added fullFormLexicon in Java 2017-08-30 08:08:19 +02:00
Krasimir Angelov
bee61fe4aa keep the language menu in the documentation always on top. 2017-08-29 21:15:40 +02:00
Krasimir Angelov
78dfc8958d document the embedded API for Java 2017-08-29 21:04:00 +02:00
Krasimir Angelov
1e4ab95e41 added option -output-format=java for producing code for embedded grammars in Java 2017-08-29 20:53:47 +02:00
Krasimir Angelov
03479648ad document the embedded grammars in Haskell & Java 2017-08-29 19:51:33 +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
62e5852669 Merge branch 'master' of www.grammaticalframework.org:/usr/local/www/GF 2017-08-29 18:03:56 +02:00
Krasimir Angelov
dc0b68cd40 document the visitor pattern in Java 2017-08-29 18:03:26 +02:00
Krasimir Angelov
e9e5952eac implemented visitor pattern in Java 2017-08-29 17:55:30 +02:00
Thomas Hallgren
c75d95b313 Merge https://github.com/GrammaticalFramework/GF 2017-08-29 16:00:04 +02:00
Inari Listenmaa
b5f2380821 Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2017-08-29 15:44:54 +02:00
Krasimir Angelov
77e9f40bde added signatures for missing API functions in Java. The implementation is still missing 2017-08-29 15:36:27 +02:00
Krasimir Angelov
adcc6a53fe a preliminary version of the C# documentation 2017-08-29 15:28:37 +02:00
Krasimir Angelov
634ec20b38 corrected and tested documentation for Java 2017-08-29 14:42:52 +02:00
Krasimir Angelov
09d5d9b091 some missing pieces of documentation for Java 2017-08-29 14:17:28 +02:00
Krasimir Angelov
2f4ed21109 rename unApply to unApp in the Java binding to be consistent with Haskell & Python 2017-08-29 14:03:17 +02:00
Krasimir Angelov
b524a5a908 final fixes for the Haskell documentation 2017-08-29 13:59:30 +02:00
Krasimir Angelov
d8e552ecdc Merge branch 'master' of www.grammaticalframework.org:/usr/local/www/GF 2017-08-29 12:00:24 +02:00
Thomas Hallgren
1f4807105b Merge https://github.com/GrammaticalFramework/GF 2017-08-29 12:00:05 +02:00
Krasimir Angelov
7876848375 remove the TODOs from the runtime documentation 2017-08-29 12:00:00 +02:00
Krasimir Angelov
c3b0b6dc4b Merge branch 'master' of www.grammaticalframework.org:/usr/local/www/GF 2017-08-29 11:58:33 +02:00
Krasimir Angelov
20b72f477a added bracketedLinearize in the Haskell binding 2017-08-29 11:58:12 +02:00
Thomas Hallgren
685307bf0d Merge branch 'master' of www.grammaticalframework.org:/usr/local/www/GF 2017-08-28 21:37:35 +02:00
Thomas Hallgren
fe2aeb839b Download page: adding a .deb package for the Raspberry Pi 2017-08-28 21:37:09 +02:00
Thomas Hallgren
4e4d07aeae Merge https://github.com/GrammaticalFramework/GF 2017-08-28 17:20:03 +02:00
Krasimir Angelov
d4026a64f4 tabularLinearize in the Haskell binding 2017-08-28 15:09:34 +02:00
Krasimir Angelov
a0fc2f28e8 more in the runtime documentation 2017-08-28 14:23:47 +02:00
Krasimir Angelov
85417da2e3 small typo in the documentation 2017-08-24 22:36:55 +02:00
Krasimir Angelov
d53a75728e Merge branch 'master' of www.grammaticalframework.org:/usr/local/www/GF 2017-08-24 22:34:59 +02:00
Krasimir Angelov
65037bfe01 more work on the runtime documentation 2017-08-24 22:33:40 +02:00
Thomas Hallgren
7ec6590389 Merge https://github.com/GrammaticalFramework/GF 2017-08-24 18:20:03 +02:00
Krasimir Angelov
9761b060f6 fix the API's links on the home page 2017-08-24 18:13:21 +02:00
Krasimir Angelov
6845e7cf35 Merge branch 'master' of www.grammaticalframework.org:/usr/local/www/GF 2017-08-24 18:11:19 +02:00
Krasimir Angelov
a1ff75d208 The documentation for the Python API is now partly ported for Haskell and Java 2017-08-24 18:10:21 +02:00
Inari Listenmaa
e31ab1c41a Remove Basque from the list of incomplete languages. 2017-08-24 18:35:13 +03:00
Inari Listenmaa
a532cec58c Add Basque to the RGL 2017-08-24 18:30:24 +03:00
Krasimir Angelov
0003522850 Merge branch 'master' of www.grammaticalframework.org:/usr/local/www/GF 2017-08-23 18:54:18 +02:00
Krasimir Angelov
d60aa643fe Merge branch 'master' of www.grammaticalframework.org:/usr/local/www/GF 2017-08-23 15:42:15 +02:00
Krasimir Angelov
7c1d50da81 Merge pull request #9 from ayberkt/master
First round of cleanups and fixes for the Turkish resource grammar
2017-08-23 15:41:47 +02:00
Ayberk Tosun
ad856840de Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2017-08-23 16:37:28 +03:00
Ayberk Tosun
fd100347fd Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2017-08-23 11:38:13 +03:00
Krasimir Angelov
fb2bf940d6 Merge branch 'master' of https://github.com/ayberkt/GF 2017-08-22 22:22:19 +02:00
Krasimir Angelov
00388039f1 a nicer pretty printing for the PGF format 2017-08-22 21:13:21 +02:00
Krasimir Angelov
82153bf271 fix the id for fidStart in the C runtime 2017-08-22 20:28:59 +02:00
Krasimir Angelov
af27715f43 Merge branch 'master' of www.grammaticalframework.org:/usr/local/www/GF 2017-08-22 20:21:03 +02:00
Krasimir Angelov
8317e09036 the parser in the C runtime now respects linref too 2017-08-22 20:18:20 +02:00
Ayberk Tosun
115b11feea Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2017-08-22 17:49:59 +03:00
Ayberk Tosun
bad42bbe00 Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2017-08-22 16:16:43 +03:00
Ayberk Tosun
cca1025d44 Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2017-08-22 11:39:13 +03:00
Krasimir Angelov
6647ed0aeb Merge branch 'master' of www.grammaticalframework.org:/usr/local/www/GF 2017-08-21 20:42:52 +02:00
Ayberk Tosun
36b5707b5a Merge remote-tracking branch 'remotes/upstream/master' 2017-08-21 16:28:10 +03:00
Aarne Ranta
38fd84a28c Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2017-08-21 16:20:27 +03:00
Aarne Ranta
f7312b3f4c ChunkJpn import list updated 2017-08-21 16:20:13 +03:00
Krasimir Angelov
dbac0b184f Merge branch 'master' of www.grammaticalframework.org:/usr/local/www/GF 2017-08-21 15:08:55 +02:00
Krasimir Angelov
a6cf33f226 added .gitignore 2017-08-21 15:08:20 +02:00
Krasimir Angelov
6e5f2b076d fix for linearization of metavariables 2017-08-21 15:04:46 +02:00
Ayberk Tosun
efa60951f9 Add *.gfo to gitignore 2017-08-21 15:59:28 +03:00
Aarne Ranta
74fd6eef3b AppUrd added 2017-08-21 15:06:46 +03:00
Inari Listenmaa
0a47cd036e Merge pull request #6 from Kaljurand/est-lexicon-fixes
Fixes to the Estonian lexicon
2017-08-21 14:43:36 +03:00
Thomas Hallgren
84c262a8e1 Merge https://github.com/GrammaticalFramework/GF 2017-08-21 13:15:46 +02:00
Krasimir Angelov
2174bd5f12 Merge branch 'master' of www.grammaticalframework.org:/usr/local/www/GF 2017-08-21 13:06:50 +02:00
Thomas Hallgren
a16ae62503 Merge https://github.com/GrammaticalFramework/GF 2017-08-21 09:40:03 +02:00
Inari Listenmaa
c89759e638 Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2017-08-21 10:26:57 +03:00
Thomas Hallgren
13aff8a704 Merge https://github.com/GrammaticalFramework/GF 2017-08-20 22:20:03 +02:00
Krasimir Angelov
dfc32b9616 lookupSentence is now available from Python 2017-08-20 20:21:33 +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
5ab8b7082c Merge branch 'master' of www.grammaticalframework.org:/usr/local/www/GF 2017-08-18 11:55:16 +02:00
Thomas Hallgren
1318a62da0 Home page: update link to PGF library API (Haskell)
to point to gf-3.9 in Hackage.
2017-08-18 11:54:13 +02:00
Thomas Hallgren
c642421fa9 configure.ac: use a Cabal-friendly version number
and replace the outdated URL
2017-08-17 11:58:23 +02:00
Thomas Hallgren
2d85550e54 Final changes before the release of GF 3.9 2017-08-11 21:11:24 +02:00
Krasimir Angelov
f71b96da2d more release notes about the runtime 2017-08-11 20:17:37 +02:00
Krasimir Angelov
e914355565 release notes about the lookup 2017-08-11 20:13:45 +02:00
Thomas Hallgren
06bf8454f7 Merge branch 'master' of www.grammaticalframework.org:/usr/local/www/GF 2017-08-11 16:05:44 +02:00
Thomas Hallgren
da1272c36d Some updates in index-next.t2t and release-next.t2t 2017-08-11 16:04:57 +02:00
Thomas Hallgren
ce1c1042e7 gf.cabal: don't enable warnings about unused imports by default 2017-08-11 15:45:19 +02:00
Thomas Hallgren
8484dabd5b Disable detailed version info from darcs
TODO: get version info from git instead.
2017-08-11 15:33:21 +02:00
Thomas Hallgren
9a39476e5a src/runtime/java/Makefile: fixes to find jni.h and jni_md.h in more cases 2017-08-11 15:09:28 +02:00
Thomas Hallgren
a0e7e3bf83 A couple of fixes for GHC 8.2.1 compatibility 2017-08-11 10:07:43 +02:00
Aarne Ranta
0806b8b80e release notes on RGL and UD 2017-08-10 16:53:55 +02:00
Krasimir Angelov
a8eeb49767 the linearizer API now allows to detect metavariables. This is used for instancein the lookup where the tokens produced from the metavariables are interpreted as distinct from all other tokens. 2017-08-07 16:39:19 +02:00
Krasimir Angelov
a4c19875ed fix the sentence lookup for cases when the top category is undefined. 2017-08-07 14:47:20 +02:00
Krasimir Angelov
ed33e53b2e added org.grammaticalframework.pgf.Expr.unStr 2017-08-07 11:48:40 +02:00
Krasimir Angelov
a4b6c8cb1b added the Expr.unMeta method in the Java binding 2017-07-07 11:21:34 +02:00
Thomas Hallgren
cd817abc5a Merge branch 'master' of /usr/local/www/GF 2017-06-30 15:46:46 +02:00
Thomas Hallgren
b87cefb8cf gf.cabal: update bug-reports and tested-with 2017-06-30 15:46:07 +02:00
Inari Listenmaa
55b52df24d Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2017-06-30 15:31:23 +02:00
Thomas Hallgren
a0072a5487 Updates to reflect the darcs->git move in the developer guide and the download page & release notes for the next release 2017-06-30 15:16:52 +02:00
Inari Listenmaa
899dba88b7 Merge branch 'master' of https://github.com/GrammaticalFramework/GF 2017-06-29 20:14:32 +02:00
Thomas Hallgren
ff82b0980b Link to the issue tracker on GitHub 2017-06-29 17:27:36 +02:00
Thomas Hallgren
366f75d78a index.html: a quick news item about the move to GitHub 2017-06-29 15:15:52 +02:00
Thomas Hallgren
1ada3fc522 gf.cabal: update the source repository to point to the GitHub repository 2017-06-29 14:51:27 +02:00
krasimir
3464e912c1 filtering during the lookup nicely integrates with concretization 2017-06-27 19:30:43 +00:00
krasimir
e8726b1cfa faster lookup 2017-06-23 17:52:43 +00:00
hallgren
fcde05237a Adding preliminary release notes and download pages for the next release of GF
Feel free to add things to download/release-next.t2t.
2017-06-19 13:56:52 +00:00
aarne
d51cbb0f1a added Arabic question mark to arabic and persian transliterations, as well as the zero-width non-joiner U+200C to persian" 2017-06-14 12:32:17 +00:00
krasimir
ecbe747cbc bugfixes in the Java binding 2017-06-10 19:31:06 +00: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
krasimir
2af8ffb269 fix in the lookup debuger 2017-06-01 09:08:42 +00:00
krasimir
20a4887311 reintroduce counts as a prefilter before applying cosine similarity 2017-06-01 09:06:35 +00:00
krasimir
2036606d61 more debug information in the lookup 2017-06-01 08:27:02 +00:00
john.j.camilleri
a251baddc0 add links to the Java and .NET APIs from the home page 2017-05-31 19:10:03 +00:00
krasimir
539a1a7d23 a bit more documentation copied from Java 2017-05-31 19:01:04 +00:00
krasimir
957bc999a3 bits of documentation for the .NET binding 2017-05-31 18:48:56 +00:00
krasimir
e1cec06f74 .NET binding to GF by Bjørnar Luteberget 2017-05-31 13:48:36 +00:00
krasimir
2a8d2806e4 lookup for syntagmatic words 2017-05-30 12:35:02 +00:00
krasimir
bf3557cf90 finally a smoothed and more precise ranking for lookups 2017-05-30 11:42:32 +00:00
krasimir
4c59db0dac another fix for the compilation of the bindings to the runtime 2017-05-26 08:54:12 +00:00
krasimir
8de69b0c31 an optimized string kernel 2017-05-24 19:44:32 +00:00
krasimir
f612311c65 fix in linearizer.h to make the JAVA binding compile 2017-05-23 21:11:11 +00:00
krasimir
cb67a24c99 an optimized expression extraction in the lookup 2017-05-23 21:06:17 +00:00
krasimir
622274180a a naive buf working ranking in the sentence lookup 2017-05-23 14:07:55 +00:00
krasimir
08f9f6fbaf bugfix in the stack handling during lookup 2017-05-16 10:55:00 +00:00
krasimir
151184718d bugfix in the Java binding 2017-05-15 08:45:40 +00:00
krasimir
27bb1398b4 add lookup.c to Android.mk 2017-05-13 11:23:19 +00:00
krasimir
578f84dd4f switch off the debugging mode in the sentence lookup 2017-05-12 11:13:15 +00:00
krasimir
2b911792ee sentence lookup API from Java 2017-05-12 11:12:29 +00:00
krasimir
7db25c5a74 bugfix in the sentence lookup 2017-05-12 10:51:49 +00:00
krasimir
ca891c912b a binding to the sentence lookup from Haskell 2017-05-12 09:32:25 +00:00
krasimir
577b7662d8 the first prototype for sentence lookup 2017-05-12 09:31:47 +00:00
krasimir
ebb085326e just for fun: hashCode for expressions 2017-05-11 13:41:41 +00:00
krasimir
c2c95644bd an API for inspecting expressions in Java 2017-05-11 13:35:56 +00:00
krasimir
a839bdc687 bugfix for print names in the C runtime and expose the functionality from Java 2017-05-11 09:11:30 +00:00
krasimir
2cf98147e6 construction of Int and Float literals in the Java binding 2017-05-11 07:44:10 +00:00
krasimir
a77ae5da30 added Expr.apply 2017-05-10 14:41:55 +00:00
krasimir
83117602af bugfix in the Java binding 2017-05-10 13:31:14 +00: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
krasimir
2675aec1f9 a simple optimization for getCategories, getFunctions, getFunctionsByCat in the Java binding 2017-05-10 12:46:32 +00:00
krasimir
6283489260 finished Type.getHypos & added Hypo.getType 2017-05-10 12:19:27 +00:00
krasimir
2f9c1c3764 a partial implementation for Type.getHypos. at least it lets us to count the number of arguments to a function 2017-05-10 08:40:12 +00:00
krasimir
7d0779dfcc some extensions in the conceptual editor needed for the SBAR app 2017-05-06 07:46:39 +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
hallgren
6d56571d46 minibar_translations.js: remove dead code 2017-05-05 13:54:43 +00:00
krasimir
7dd171cdcc optimize memory allocation in the lookup by using worker pools 2017-05-04 08:29:51 +00:00
krasimir
a05194a350 remove duplicate entries from the lookup index 2017-05-04 08:21:29 +00:00
krasimir
73e9eb934a merging spines 2017-05-04 07:55:11 +00:00
krasimir
d0269e8513 first steps for sentence lookup in the C runtime 2017-05-03 16:28:20 +00:00
krasimir
5f4c441361 add install pragma for CMake 2017-04-19 20:21:20 +00:00
krasimir
1bfeab104c more changes to make the C runtime compilable with MSVC 2017-04-19 18:59:42 +00:00
aarne
2bdfd27173 updated android app help file 2017-04-19 17:26:51 +00:00
krasimir
25e14b253d now the database with glosses is compiled on the PC by running glosses.hs. On the phone we just extract the database 2017-04-19 13:00:46 +00:00
krasimir
5c93f2fba5 in libgu mark explicitly all functions that belong to the API 2017-04-19 12:30:40 +00:00
krasimir
74ce52d761 in the Java binding mark all internal functions as hidden 2017-04-19 11:08:09 +00:00
krasimir
7d72d99c2f explicitly classify all functions in libpgf as either internal or API functions 2017-04-19 09:34:23 +00:00
krasimir
33ec916c9c make some of the functions in the Python binding static 2017-04-19 09:45:15 +00:00
krasimir
7b0e1b164c add the CMakeLists.txt from Bjørnar 2017-04-13 14:23:26 +00:00
krasimir
7455e7bff9 disable doxygen 2017-04-13 14:11:47 +00:00
krasimir
9189f4b739 updated AUTHORS list in the C runtime 2017-04-13 14:00:45 +00:00
krasimir
a8e37ff135 remove src/runtime/c/README it is obsolete anyway 2017-04-13 13:57:37 +00:00
krasimir
71a9f2cba8 use gu_string_buf_data in the Python binding to avoid copying 2017-04-13 13:47:13 +00:00
krasimir
2588a6f016 gu_string_buf -> gu_new_string_buf in libgu 2017-04-13 13:43:48 +00:00
krasimir
e650b9c5fc use gu_string_buf_data in the Java binding to avoid double copying of strings 2017-04-13 13:21:32 +00:00
krasimir
9aeb45e1cc full support for Latin1 GF identifiers in the C runtime 2017-04-13 12:57:11 +00:00
krasimir
df6c2f3f17 add gu_string_buf_data and gu_string_buf_length in libgu 2017-04-13 12:55:29 +00:00
krasimir
2551ab740b silence a few warnings on MacOS 2017-04-13 11:07:08 +00:00
krasimir
a657e9947b use GU_API_DATA_DECL instead of GU_API_DATA to make the C runtime compile again on MacOS 2017-04-13 11:06:24 +00:00
aarne
7963c85367 Translator.java in android app now tries to find the lowercased first word in the lexicon if uppercased fails; added Est and Rus in the help file 2017-04-12 14:21:54 +00:00
krasimir
e369427990 update SG.hsc 2017-04-12 11:55:27 +00:00
krasimir
456f0a5733 remove the teyjus and utils folders 2017-04-12 10:31:01 +00:00
krasimir
a8eaa2f2e5 a patch from Bjørnar Luteberget for compatibility with MSVC 2017-04-12 10:24:56 +00:00
krasimir
915747efa7 some work on libsg queries 2017-04-12 10:05:22 +00:00
aarne
f2ba7b64bf commented out case_sensitive=off in App 2017-04-12 08:59:58 +00:00
aarne
dd61e1dc19 re-enabled Phrasebook in App ; added Russian ; testing with lower-casing the input 2017-04-11 15:48:18 +00:00
krasimir
23f740d3b9 upgrade Android SDK version 2017-04-11 13:40:02 +00:00
krasimir
5251221339 forgot src/ui/android/res/layout/fragment_phrase_list.xml 2017-04-11 12:54:23 +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
1e33235144 fixed a bug in Eq instance generation for GADT and lexical categories 2017-03-22 22:25:21 +00:00
krasimir
f09507cb0f fix the compilation of sqlite3Btree.c on Windows 2017-03-14 11:07:14 +00:00
krasimir
f1240ef489 a better error message 2017-03-07 23:17:24 +00:00
normundsg
31cd69b730 News: GFSS 2017 2017-03-13 14:31:50 +00:00
krasimir
7361d22059 GF.Compile.Compute.ConcreteNew now handles Predef.Float 2017-03-07 19:50:43 +00:00
krasimir
2e5499ba97 bugfix in record subtyping checking 2017-03-07 17:53:56 +00:00
krasimir
5ec43f2f75 GF.Grammar.Printer now has a Terse mode which prints record types with lock fields with their corresponding abstract categories 2017-03-07 08:24:00 +00:00
krasimir
5a61ab5fcc fix for EPatt 2017-03-06 17:15:46 +00:00
krasimir
6c5cfa7750 type checking EPatt 2017-03-06 16:24:58 +00:00
krasimir
a0d6a4f9a4 GF.Compile.Compute.ConcreteNew now can handle EPattType 2017-03-06 15:44:25 +00:00
krasimir
fe4f38f6ee some missing patterns 2017-03-06 14:44:03 +00:00
krasimir
ad2a18592b added overload resolution in the experimental type checker 2017-03-06 14:09:16 +00:00
krasimir
2c1c2da89f some progress on the experimental type checker for the concrete syntax 2017-03-03 16:37:22 +00:00
aarne
34627e7427 corrected fg generation for lexical categories, to avoid a type error in generated code 2017-02-24 20:50:36 +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
krasimir
94f41cc63d safer memory management in the Haskell binding 2017-02-10 17:10:37 +00:00
hallgren
d0f7f9ca8d langcode.js: updated to include codes for recently added RGL languages 2017-02-10 12:18:36 +00:00
hallgren
de6c897bd3 GF home page: comment out the "GF build status" link
Gregoire's Jenkins server has been down since last summer...
2017-02-10 12:14:22 +00:00
krasimir
011d2a44b8 typo in gf-tutorial: enougo->enough 2017-02-01 14:59:35 +00:00
krasimir
1188cf0c3e replace .gfcc with .pgf in gf-refman.html 2017-02-01 10:48:48 +00:00
aarne
65d1867fe3 typo in imports of SentencesPes corrected 2017-01-30 22:17:00 +00:00
krasimir
0e49c28e5b API for computing the Haskell binding 2017-01-26 18:41:07 +00:00
krasimir
1cea621216 use throwIO instead of throw in a few placed 2017-01-26 18:40:36 +00:00
krasimir
af1a581f40 type checking API in the Haskell binding 2017-01-26 14:09:07 +00:00
krasimir
24671a612c a better implementation for PGF2.categories 2017-01-26 13:37:12 +00:00
krasimir
bd1128e303 now the Python API also accepts types as start categories. Using a string is still ok. 2017-01-26 13:31:08 +00:00
krasimir
77b84fdbcd forgot to add src/runtime/haskell-bind/PGF2/Type.hsc 2017-01-26 13:00:22 +00:00
krasimir
3467a54965 bring the Haskell binding a bit closer to the pure Haskell API 2017-01-26 12:48:22 +00:00
krasimir
17163ae881 copy the types for BracketedString from the Haskell runtime to the Haskell bindings 2017-01-26 10:31:43 +00:00
krasimir
6af632dd18 added mkMeta and unMeta in the Haskell binding 2017-01-26 10:17:02 +00:00
krasimir
be43d5dfdc added mkAbs and unAbs in the Haskell binding 2017-01-26 10:04:42 +00:00
krasimir
a06e0b6b6f more startCat to the Types section in the Haddock documentation for the Haskell binding 2017-01-26 06:41:27 +00:00
krasimir
14b32a115c add unStr,unInt and unFloat in the Haskell binding 2017-01-26 06:40:13 +00:00
krasimir
db0f8b0dce improve the documentation for PGF2 2017-01-25 20:30:54 +00:00
krasimir
6de9636ff2 add functionsByCat in the Haskell binding 2017-01-25 10:44:08 +00:00
krasimir
8d3464dfb0 bugfix in the Haskell binding 2017-01-25 10:37:34 +00:00
krasimir
3c36318246 added linearizeAll in the Java API 2017-01-24 10:14:12 +00:00
krasimir
f6ecf0ce56 resolve a conflict that was for some reason commited in src/runtime/java/Makefile 2017-01-24 09:36:39 +00:00
aarne
1dbba8f377 added Ice and Nno to synopsis and ResourceDemo, and updated documentation 2017-01-19 19:58:48 +00:00
john.j.camilleri
efe7db3269 GF Summer school now links to the 2017 school (update from Normunds). 2017-01-05 21:51:03 +00:00
aarne
290ea53ae9 news on tech talk, nynorsk, and github mirror problems; contrib github to main meny 2016-09-21 12:40:18 +00:00
prasanth.kolachina
ef33f1ab35 python examples compatible with both Python 2 and 3 2016-09-19 08:32:08 +00:00
aarne
8729339d26 BNF grammars (.bnf or .cf) can have rules without semicolons, as in the GF book examples. However, if the grammar has any multiline rules, all of them must have semicolons. 2016-09-05 21:15:44 +00:00
krasimir
06599df74d update the Python tutorial to be compatible with Python3 2016-08-01 10:55:57 +00:00
krasimir
5a9b5dc860 python2 is now supported. the patch is based on a contribution from Vinit Ravishankar 2016-08-01 10:39:54 +00:00
krasimir
2605ee85d7 two memory leaks in the Python bindings 2016-08-01 10:31:37 +00:00
krasimir
bc1aded860 fix in topics.txt 2016-07-20 05:36:39 +00:00
krasimir
ae8c6909f7 extended topics.txt 2016-07-20 05:11:51 +00:00
hallgren
7863a383b0 gf.cabal: bump version to 3.8-darcs 2016-07-05 10:27:00 +00:00
aarne
a1d226891b rbmt summer school announcement 2016-06-26 09:08:30 +00:00
hallgren
ee9fcef787 Final changes for the GF 3.8 release
News item on the home page
Put the download page and release notes in place.
Add an entry in debian/changelog.
Update the version number in gf.cabal.
2016-06-22 11:13:06 +00:00
hallgren
76fd94f82c A couple of more adjustments of the GF 3.8 release notes. 2016-06-22 10:38:51 +00:00
hallgren
27a49f983e Some adjustments to the GF 3.8 release notes and download page 2016-06-22 08:23:37 +00:00
krasimir
9238941c4d some more bullets in the release notes 2016-06-22 07:32:48 +00:00
hallgren
ab138e5a8c bin/build-binary-dist.sh: fixes for the Java and Python bindings.
* Just skip the Java binding if there were errors compiling it.

* Install the Python binding in the expected place on Mac OS X when creating
  an OS X installer package. (i.e. under /Library/Python/2.7/site-packages)

Also updated the 3.8 download page and release notes to reflect the above.
2016-06-20 14:11:45 +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
5b8c6887ca Documentation updates
Remove ghc-7.4 from the list of tested/recommended versions of GHC
(because of Hackage dependency problems).
Recommend version 7.10.3 of the Haskell Platform. (GHC 8.0.1 works too,
but I haven't tested the corresponding Haskell Platform packages.)
2016-06-17 10:09:25 +00:00
john.j.camilleri
5155495ba5 Wide Coverage Translation Demo: switch to App16.pgf (adds Russian) 2016-06-17 10:19:46 +00:00
hallgren
c49b920ecf A few documentation updates
gf.cabal: include more GHC versions in the Tested-Width field.
2016-06-16 15:09:45 +00:00
hallgren
e608a63f80 debian: add txt2tags to Build-Depends and run 'make html' as part of the build
This is to make sure that gf-web-api.html gets included in the .deb package
and is available locally in the GF cloud when running gf -server.
2016-06-16 13:54:15 +00:00
hallgren
041b1b24e5 gf-web-api.t2t: document command=deptree (for word dependency diagrams)
Also add a few paragraphs listing undocumented commands and
briefly describing the commands that use the C run-time system.
2016-06-16 13:34:48 +00:00
krasimir
416406fa9b fix in the Android UI 2016-06-16 12:56:56 +00:00
hallgren
70952bd906 src/www/gf-web-api.t2t: Web API docs rescued from the Google Code graveyard
This is the GFWebServiceAPI.wiki rescued from the Google Code Archive,
converted to txt2tags format, with an updated introduction.
2016-06-16 12:11:06 +00:00
hallgren
a1a7fa77c0 GF home page: add new RGL languages to the list
Also a couple of fixes in release-next.t2t
2016-06-16 10:09:01 +00:00
hallgren
3f27aeb618 gf.cabal: don't build pgf-shell any more, it's been superceded by gf -cshell 2016-06-16 09:57:28 +00:00
aarne
14ed164794 release note on new languages 2016-06-16 08:28:54 +00:00
krasimir
8b8812baa2 pgf_generate_all now emits __mock_string__ instead of FOO for String literals. 2016-06-16 08:08:45 +00:00
krasimir
821878773c bugfix in the load method in the Python binding. The file was never closed. 2016-06-16 08:02:06 +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
12d2296991 GF cloud: more readable formatting of the GF version page
Factor out common CSS from gfse/editor.css into clouds.css.
2016-06-15 10:20:30 +00:00
hallgren
1465a825d5 release-next.t2t: notes about the vd and cc commands 2016-06-15 08:04:10 +00:00
aarne
7633f53af4 release notes on RGL 2016-06-10 11:27:24 +00:00
hallgren
fb82895996 release-next.t2t: a few more notes 2016-06-10 09:14:19 +00:00
hallgren
18f17ba857 minibar: define grammar_list in config.js to restrict the grammar menu
minibar.html now reads config.js and if it defines grammar_list, only the
grammars listed there will show up in the grammar menu.
2016-06-09 14:20:24 +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
krasimir
60e07c302e now a working API for complex queries in libsg 2016-06-09 10:01:43 +00:00
krasimir
28aa04739a bugfix in libsg 2016-06-09 09:59:38 +00:00
hallgren
5d27d1885f Minibar: show word dependecy diagrams
They are now included in the cycle of images shown when clicking on the
parse tree icon.
2016-06-08 19:11:49 +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
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
hallgren
5b491b7312 Minibar: remove spaces for better Thai speech synthesis 2016-06-06 10:46:13 +00:00
aarne
e755c013f8 added PassAgentV2 to App, and the specialized syntax functions to app.probs 2016-06-05 17:48:11 +00:00
hallgren
bd8c6cc4e4 Minibar: detect the language for show speech synthesis buttons in more cases
This was done to obtain speech synthesis for more languages in the Numerals
grammar, which uses neither language flags nor the standard naming for
concrete syntax.
2016-06-05 12:21:56 +00:00
aarne
e682f0972d made App into a functor to make its body easier to modify; unfortunately, the import list must be copied however 2016-06-04 17:07:35 +00:00
aarne
4fea4ace7b vd latex: some adjustments in heights and lengths 2016-06-03 16:06:22 +00:00
krasimir
2652082cf7 now the UI supports almost all phrases. there are still a few that cannot be shown 2016-06-03 11:30:53 +00:00
krasimir
fa9fca2c06 the Phrasebook UI now uses the green color 2016-06-03 11:30:21 +00:00
krasimir
ce856a2d17 added checkboxes in the Phrasebook UI 2016-06-03 11:09:39 +00:00
krasimir
e8fe5ad5f1 bugfix in the Phrasebook UI 2016-06-03 07:14:52 +00:00
krasimir
5d516661f7 the list of alternatives in the translator is now sorted by probability 2016-06-02 07:38:18 +00:00
krasimir
fce8a7a069 bug fix in the translator app 2016-06-02 07:38:00 +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
deb7919aa6 Enable compilation of Ancient Greek in Setup.hs
Also adjust the -path pragmas in a few places in lib/src/ancient_greek
2016-06-02 13:56:19 +00:00
hallgren
f24e073637 release-next.t2t: adding a few items 2016-06-02 13:06:04 +00:00
aarne
a6303fd8d1 tokenized apertium text to test with ; RelV2 and QuestV2 in App (Eng and Swe for the moment) with 20% loss of parsing speed but improved quality 2016-06-02 06:29:35 +00:00
krasimir
194368dfd5 majour redesign of the Phrasebook UI to support recursive phrases 2016-05-30 23:24:17 +00:00
krasimir
ed1e60f633 fix in the Haskell binding: functionType should throw error if the function is not defined 2016-05-30 17:15:09 +00:00
krasimir
3381ae1aa0 added getFunctionProb in the Java and C API 2016-05-30 11:25:59 +00:00
hallgren
a00532d5e4 download/{index,release}-next.t2t added, in preparation for the next release
Feel free to add things to the release notes in download/release-next.t2t.
2016-05-26 16:16:33 +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
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
krasimir
a775c96174 preserve the order of the sentences in phrases.xml in the UI 2016-05-25 18:55:47 +00:00
krasimir
19c22c9020 the phrasebook phrases are now ordered in the same way as in the Phrasomatic 2016-05-25 18:33:12 +00:00
krasimir
69433b9660 the Java API now also has access to the token's category while doing completion 2016-05-25 12:39:51 +00:00
krasimir
13f9a42ae5 fix the word completion in the C runtime 2016-05-25 12:19:26 +00:00
krasimir
0894f55661 fix the compilation when debugging is switched off 2016-05-25 09:42:24 +00:00
krasimir
faebebc8f4 pgf_generate_all now works with literals as well 2016-05-25 09:36:05 +00:00
krasimir
41a3054e9b when expressions with Float literals are printed, we should use the same format that is used by the linearizer 2016-05-25 09:34:40 +00:00
krasimir
b34ee6f377 fix a warning in libsg 2016-05-25 07:18:01 +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
krasimir
228161eed4 add the relevant code from Parlira to the GFTranslator 2016-05-23 09:54:27 +00:00
hallgren
649ab21cec Changes for compatibility with GHC 8.0.1 2016-05-22 20:15:31 +00:00
krasimir
afd7e5392d fix the Estonian language code in the App 2016-05-22 11:20:14 +00:00
krasimir
e56b56a57f bugfix in libsg 2016-05-22 09:19:54 +00:00
krasimir
fdf4bd3196 change the API for literals in Java and Python. The input sentence is no longer a parameter to the callbacks. 2016-05-20 15:20:02 +00:00
krasimir
1a0defc0fc in case of null argument it is more intuitive to report the argument index by counting from 1. 2016-05-19 20:48:47 +00:00
krasimir
4996d5d90b the constructor for expressions in the Java runtime now checks for null arguments. This means that a potential problem is detected earlier before we jump into the JNI code. 2016-05-19 20:41:09 +00:00
krasimir
214d1b1e70 fix in the Android App after the introduction of sqlite3Btree.c 2016-05-19 15:26:59 +00:00
hallgren
7cb01f1ae7 Wide Coverage Translation Demo: improvements relating to application grammars
* Automatically update the translations when the set of selected
  application grammars is changed.
* Skip application grammars that do not support the currently selected
  source & target languages.
2016-05-19 09:36:40 +00:00
krasimir
bea8c5796a fix the compilation of sqlite3 on MacOS 2016-05-18 09:01:47 +00:00
hallgren
5497f88b15 Wide Coverage Translation Demo: a couple of small fixes
Add missing initalization after a new application grammar has been selected.
Add an "X" close button in the upper left corner of the grammar selection popup.
2016-05-16 14:43:51 +00:00
hallgren
6405850057 Wide Coverage Translation Demo: you can now reorder the application grammars
When selecting which application grammars to use for translation, after
pressing the "Grammars..." button, it is now possible to change the order
of the selected grammars by dragging them up and down in the list.
2016-05-16 14:14:55 +00:00
hallgren
0d4c64703e gfse/sort.js: enable dragging on touch screens 2016-05-16 12:57:01 +00:00
aarne
808bbf7466 enabling V3 and V2V in AppFre 2016-05-14 08:55:47 +00:00
aarne
7c8d2f71dc commented out the import of Phrasebook in App with --P; the idea is that application grammar parsing is done in a separate phase, which is faster and more flexible. Also re-enabled ComplV3 and ComplV2V, after testing that they don't reduce the parsing speed too much. 2016-05-14 08:30:49 +00:00
hallgren
bde9dc7cfd Add a few missing languages in js/langcode.js. Use it also in gfse/editor.js.
gfse/editor.js had its own list with 34 languages, while js/langcode.js
only had 30 languages. The missing languages have been added to
js/langcode.js and all apps now use that list.
2016-05-13 13:03:28 +00:00
hallgren
2b182c4e63 Wide Coverage Translation Demo: select application grammars to use from a list
There is now a new button "Grammars..." which show a list where users can
select which application grammars to use for translation, in addition to
the wide coverage grammar. Application grammars can give higher quality
translations in the domain they cover.
TODO: make it possible control the order of the selected application grammars.
2016-05-12 17:53:56 +00:00
hallgren
c8476832f4 langcode.js: add Afrikaans 2016-05-12 15:28:11 +00:00
hallgren
e8fb3f93e4 translator.css: factor out div.overlay styles to a separate file overlay.css 2016-05-12 14:21:30 +00:00
krasimir
be62f4047f skeletal version of AppRus.gf 2016-05-11 11:24:31 +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
krasimir
9abc6aadde 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
403e080273 fix the offset for oracles in Haskell 2016-05-10 19:41:44 +00:00
krasimir
80a96b3a85 an API for oracles in the GF parser 2016-05-10 17:11:39 +00:00
krasimir
3f0fe438cd a prototype for complex queries over expressions in libsg 2016-04-29 14:06:24 +00:00
krasimir
a6b4212264 added methods for accessing the last element of a buffer in libgu 2016-04-29 14:05:42 +00:00
krasimir
6fb17dc6fc a version of sqlite3.c which is prunned to one third of the original size and now it contains only the database storage engine withough the SQL compiler and interpreter 2016-04-28 14:14:04 +00:00
hallgren
41171be5a6 Fix a problem building the Java binding when creating binary packages
Pass -I and -L flags to gcc so that the C run-time system can be found.

Also added a line in src/runtime/java/Makefile to install jpgf.jar.
2016-04-25 14:21:04 +00:00
krasimir
983da7adfc more fixes for GNU Lightning for ARM 2016-04-14 13:47:56 +00:00
krasimir
114e95f43b fix in evaluator.c 2016-04-14 13:47:29 +00:00
krasimir
627abeb703 added PGF.inferExpr and Type.toString in the Java binding 2016-04-14 13:12:22 +00:00
krasimir
6a0ed34b11 bugfix in GNU Lightning for ARM 2016-04-14 08:26:07 +00:00
krasimir
76a6cc1bb5 bugfix in the JIT compiler for 64bit machines 2016-04-13 14:58:12 +00:00
hallgren
83d878a636 debian/control: dependency change from libtool to libtool-bin
It seems that nowadays the libtool executable is not included in the package
named libtool, instead it is in the libtool-bin package.
2016-04-13 14:39:33 +00:00
krasimir
e8e52de6b9 locale independent printing for doubles when they are part of an abstract expression 2016-04-13 14:30:40 +00:00
krasimir
c0344e936a fix for reading PgfExpr with a double literal 2016-04-13 14:08:49 +00:00
hallgren
68ebfe9de2 Minibar: don't show dependency information in parse trees.
This was fixed by adding "&nodep=true" in the minibar when it requests a
parse tree from the server. The reason dependency information got included
in the first place was that all rendering options are on by default in
command=parsetree requests in PGF service API.
2016-04-13 13:18:18 +00:00
krasimir
f0014f61a7 added PGF.compute in the Java binding 2016-04-13 12:57:06 +00:00
krasimir
f0ca9cd732 added getFunctionsByCat 2016-04-13 12:49:08 +00:00
krasimir
1019b7faf5 added getCategories() and getFunctions() in the Java binding 2016-04-13 12:02:42 +00:00
krasimir
3ee356dee4 fix in FoodsMkd.gf 2016-04-08 15:25:12 +00:00
hallgren
1454953391 Changes to include the Java binding in binary distribution packages
This means that you now need to have a Java SDK installed to build
a Debian package.

The bin/build-binary-dist.sh (which builds bintar packages and OS X installer
packages) now skips the Python binding if python is not installed. Likewise
it skips the Java binding if a Java SDK is not installed.
2016-04-12 15:01:11 +00:00
hallgren
94b8ebf402 debian/rules: workaround for a problem on Ubuntu 15.10 and 16.04
dh_shlibdeps has a problem finding which package some of the Haskell
libraries come from, even though dpkg-query -S has no problem finding them.
But the gf executable is statically linked against the Haskell libraries, so
it will work even if these shared libraries aren't installed. But there will
be a problem if other shared libraries are missing (.e.g. libtinfo, libgmp),
so we need a better solution than simply ignoring all dependency problems...

See also http://stackoverflow.com/questions/11238134/dpkg-shlibdeps-error-no-dependency-information-found-for
2016-04-12 13:25:17 +00:00
hallgren
31df4a6c46 GF.Command.Commands2: adapt gf -cshell to the changes in the previous patch 2016-04-07 14:55:13 +00:00
hallgren
ab3cc77656 GF shell: fix a parsing problem with the cc command
This patch fixes a problem introduced last year when the GF shell was
refactored to allow more commands to be treated uniformly and be part
of pipes. The cc command was one of those commands, but unfortunately this
introduced a parsing problem, e.g.

	> cc "last"
	constant not found: last

	> cc "last"++"year"
	command not parsed: cc "last"++"year"

This happened because the generic command line parser in
GF.Command.{Abstract,Parse} assumes that all commands have an argument of
type PGF.Expr. Commands that expect other types of arguments have to
use PGF.showExpr combined with other conversion to the argument type they
expect. The cc command excpets a GF.Grammar.Term, and unfortunately not 
all terms survice the roundtrip through PGF.Expr, in part because of
an additional hack to allow strings to be roundtripped through PGF.Expr
without adding superfluous double quotes.

To solve the problem, this patch

 + makes room for arguments of type Term in the Argument type in
   GF.Command.Abstract.
   
 + makes a special case for the cc command in GF.Command.Parse, by
   calling the partial parser 'runPartial pTerm' recently added in
   GF.Grammar.Lexer and GF.Grammar.Parser. Care was taken so that
   that "|" and ";" can be used both inside terms and as separators between
   commands in the shell, e.g. things like the following now work:

       > cc ("a"|"b") | ps -lexcode
       variants { "a" ; "b" }

 + introduces a type CommandArgument that replaces [Expr] as the
   type of values passed between commands in pipes. It has room for
   values of type [Expr], [String] and Term, thus eliminating the need
   to roundtrip through the Expr type all the time.
   The hack to avoid adding superfluous quotes when strings are
   roundtripped through Expr has been left in place for now,
   but can probably be removed.
2016-04-07 13:40:05 +00:00
hallgren
65e675d8e2 Lexer.x & Parser.y: add a partial parser for terms
Lexer.x: Change the parser monad type P to allow the remaining input to
	 be returned after a partial parse. Add function

           runPartial :: P t -> String -> Either (Posn, String) (String, t)

Parser.y: Add a partial parser pTerm for nonterminal Exp1.
          Re-export runPartial.
2016-04-07 13:32:14 +00:00
krasimir
c130d28ae3 fixed Foods grammar for Macedonian 2016-04-07 10:49:35 +00:00
hallgren
c8b7ebc163 Lexer.x: fix cyclic Functor instance
It looks like I introduced this cyclic definition in August 2014, but since
it isn't used, it hasn't been a problem...
2016-04-06 13:46:48 +00:00
hallgren
ad22a4d899 src/tools: update GFDoc.hs and Htmls.hs for compatibility with current libraries and add gf-tools.cabal to compile them 2016-04-05 13:29:56 +00:00
krasimir
9db5139e23 Foods grammar for Macedonian. Probably not quite correct 2016-04-05 15:33:44 +00:00
hallgren
7d509d6933 GFSE: add Latvian to the list of RGL languages 2016-04-03 17:29:10 +00:00
hallgren
465a83cd02 src/runtime/c/INSTALL: add automake to the list of needed packages on Linux
The automake package contains aclocal, which is needed when running
autoreconf -i.

I never needed to install automake explicitly on Linux, presumably because it
got installed anyway because of some other dependency, but apparently you
can't take this for granted.
2016-03-30 11:43:16 +00:00
krasimir
a393c1a246 fix the handling of separators in BNFC which are not nonempty 2016-03-22 13:13:35 +00:00
krasimir
ce70720859 CFGtoPGF is now extended to support context-free grammars with primitive parameters 2016-03-22 10:28:15 +00:00
krasimir
fbdf21d862 added missing module GF.Grammar.BNFC 2016-03-21 20:03:28 +00:00
krasimir
8f80e5451e fix comment in GF.Grammar.CFG 2016-03-21 19:33:14 +00:00
krasimir
c8ebe09315 initial support for BNFC syntax in context-free grammars for GF. Not all features are supported yet. Based on contribution from Gleb Lobanov 2016-03-21 13:27:44 +00:00
krasimir
da10bb33c7 bugfix: GF.Compile.CFGtoPGF now supports literal categories 2016-03-21 13:26:32 +00:00
krasimir
07cf4d6509 more progress on the typechecker 2016-03-15 14:16:17 +00:00
krasimir
c1671d43e2 current state of the experimental typechecker 2016-03-07 20:20:47 +00:00
krasimir
4ba9712f16 add missing cases in vapply in the partial evaluator 2016-03-03 06:59:50 +00:00
krasimir
508bc346e5 fix in the typechecker 2016-03-02 21:28:54 +00:00
hallgren
a2922e35fd gf.cabal: Remove GF.Compile.Compute.ConcreteNew1 2016-03-02 16:29:13 +00:00
krasimir
13ff91bbb9 a better interface between the type checker and the partial evaluator 2016-03-02 16:22:56 +00:00
krasimir
47eb774cdf the experimental type checker in GF.Compile.TypeCheck.ConcreteNew is now rewriten to use the complete evaluator in GF.Compile.Compute.ConcreteNew. The old sketchy implementation in GF.Compile.Compute.ConcreteNew1 is now removed. 2016-03-02 13:38:02 +00:00
leiss
672c1e8df5 add forgotten file src/runtime/haskell/PGF/LexingAGreek.hs 2016-02-23 17:32:19 +00:00
leiss
df2901c9c0 add lexer and unlexer for Ancient Greek accent normalization 2016-02-23 16:30:39 +00:00
krasimir
8548979d1c Now we even test in two different places for the JNI headers. Once for Linux and once for Mac OS. This is still not ideal since different Linux distributions might use different locations. 2016-02-17 14:52:48 +00:00
krasimir
9e3944951c typo in the new Makefile 2016-02-17 14:40:46 +00:00
krasimir
279f66c950 a version of the Makefile for the Java binding which should work on Linux and Mac OS 2016-02-17 14:37:55 +00:00
krasimir
55a7fdc4a5 some progress on complex queries in libsg 2016-02-09 10:59:18 +00:00
hallgren
114dc54bf9 demos/index.html: a couple of fixes 2016-02-08 16:41:50 +00:00
krasimir
4a38cc1e7b fix a rather intricate bug where coercions in the PMCFG grammar didn't interact properly with the lazy parser 2016-01-26 14:29:06 +00:00
hallgren
9bed116878 GFSE: add Afrikaans to the list of available RGL languages. 2016-01-19 13:59:17 +00:00
krasimir
5576688410 javadoc comments in the Java binding 2016-01-14 19:03:13 +00:00
inari
9aeefe6925 add link to irc channel 2016-01-14 05:59:49 +00:00
krasimir
8dda2dfbff added API for reading a list of tuples in the SG module 2015-12-22 13:50:01 +00:00
krasimir
028de0468b pgf_read should close the input file. 2015-12-22 09:29:14 +00:00
krasimir
bef9d8c5fc 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
0b9395fd70 a fix that should solve the segmentation fault on MacOS with the exhaustive generator 2015-12-19 17:30:41 +00:00
krasimir
6947d36e1a fix in the Python binding. The input sentence to the parser needs to be copied since otherwise the Python string may be discarded the garbage collector 2015-12-18 19:46:59 +00:00
hallgren
fe1ce8389c feedback.cgi: exclude empty submission when showing the feedback list 2015-12-11 13:08:46 +00:00
aarne
d41d512ae3 tweaking Chi language codes to get both speech input and output in Android ; one fix in DictionaryChi 2015-12-11 10:56:07 +00:00
hallgren
6b74a90bd4 Wide Coveage Translation Demo: sort parse results by probability
Because of the "heurisitc factor", the results returned by the parser might
not be in strict probability order. To compensate, a sorting pass has been
added to find and show the translation with the highest probability among the
10 first translations.

However, this means that the translation demo now immediately has to ask for
10 translations of every segment. Before, it initially asked for only one
translation of every segment, and then 9 more translations for a segment
when/if the user clicked on it. This change can slow down translation
noticeably (e.g. from 15s 30s to load an example with fiction in English).
2015-12-10 14:27:15 +00:00
hallgren
bc644e643b Simple Translation Tool: bug fix
"File/Open In Wide Coverage Translation Demo" stopped working when support
for using different grammars in the Wide Coverage Translation Demo was added
On September 2.
2015-12-10 14:23:19 +00:00
krasimir
76bebb0656 fix in the App 2015-12-09 09:02:19 +00:00
krasimir
b1d0839650 some revisions in the list of topics 2015-12-03 21:46:12 +00:00
krasimir
0bc612f3f5 fix in the app 2015-12-03 09:03:59 +00:00
krasimir
f482300fd1 bugfixes in the app 2015-12-02 21:53:41 +00:00
krasimir
967b87d9d3 now this is a working version of the app with topic disambiguation but it is still not optimal 2015-12-02 20:47:54 +00:00
hallgren
f2b057c078 GF shell, cc command: try to compute pre{...} tokens in token sequences
This is implemented as a simple post-processing step after partial evaluation
to try compute pre{...} tokens in token sequences. Nothing is done to deal
with intervening free variants.

This was done in response to a query from René T on the gf-dev mailing list.
2015-12-02 16:41:18 +00:00
hallgren
5bb792be5e GF.Data.Str: change matchPrefix to agree with the GF book and the run-time system
The matchPrefix function is used in str2strings and the partial evaluator to
compute pre{...} tokens. But unlike the description in the GF book and
the implementation in the run-time system, matchPrefix looked at
the concatenation(!) of all following tokens and not just the next token
when deciding how to compute a pre{...} token.

This is a backwards incompatible change, but it is subtle and probably won't
cause any problems. In particular, the example grammars are unaffected.
2015-12-01 15:14:27 +00:00
hallgren
d6ae5e811b GF.Data.Str: unexport & comment out unused functions 2015-12-01 14:32:24 +00:00
krasimir
fffab87469 visualization for topics in the Android app 2015-11-28 23:15:58 +00:00
krasimir
06043c06c7 added some more topics 2015-11-28 12:24:01 +00:00
krasimir
545e1a0cc8 fix in the Java binding: the Expr class should also ensure that libjpgf.so is loaded to avoid failures if Expr is the first class that is used. 2015-11-27 15:35:53 +00:00
hallgren
724b8aa8ae Wide coverage translation demo: updated to use App15.pgf 2015-11-27 09:56:49 +00:00
krasimir
008ca97428 added Expr.equals method in the Java binding 2015-11-26 15:38:12 +00:00
krasimir
451ef1183f added list of topics in the assets folder for Android app 2015-11-26 15:19:48 +00:00
krasimir
79ea4af960 added readTriple in libsg and its Haskell binding 2015-11-25 10:37:13 +00:00
krasimir
55cfea35eb the semantic graph view in the app now shows the real number of senses 2015-11-24 20:22:01 +00:00
krasimir
9b742e6b0d modify glosses.hs to merge several examples into one 2015-11-24 19:30: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
1d80db4919 AppEst.pgf_c added to the ios project (generated file via xcode) 2015-11-19 22:25:18 +00:00
krasimir
9f9b23d0dd added mkInt and mkFloat in the Haskell binding to make it easy to create literal expressions 2015-11-19 13:18:19 +00:00
krasimir
fe7397efe4 some more conversion patterns for Susanne 2015-11-18 10:16:55 +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
krasimir
8a7254e4f9 bugfix in Translator.java 2015-11-16 20:03:40 +00:00
krasimir
105db47ee4 now the Documentation module contains a category Definition which is used to generate definitions and examples for words in the App. 2015-11-16 14:57:32 +00:00
krasimir
279fdb74b7 bugfix in the Makefile for the Java binding for creating .jar files 2015-11-16 14:39:52 +00:00
krasimir
465aa785cf add a few popup characters on the qwerty and the nordic keyboards 2015-11-16 13:21:43 +00:00
krasimir
f3a15303b1 update glosses.hs to split definitions from examples in separate triples 2015-11-13 22:41:20 +00:00
krasimir
ebb3abad9f now by default the app shows glosses for the words for which we have something. this requires one more step in the App compilation which is described in the README 2015-11-13 17:28:11 +00:00
krasimir
634d3dff7d bugfix in the SG binding for Java 2015-11-13 17:21:27 +00:00
krasimir
f6bb796276 added Java API for insertion of triples in the semantic graph 2015-11-13 14:34:24 +00:00
krasimir
6011fbc033 a new version of the conversion script for the Susanne corpus which covers a bit less than half of the data 2015-11-13 13:05:21 +00:00
aarne
b33ea36c18 ios fix: spaces should be removed from Chi but not from Cat 2015-11-11 15:43:48 +00:00
aarne
d452984bb5 src/ui/ios/GF-Offline-Translator tested to work in XCode with the current GF runtime and grammars. However, AppEst crashes the app - remains to find out why 2015-11-11 14:19:17 +00:00
cenny
e95037b850 iOS app sources copied from https://github.com/cennydavidsson/GF. Not yet tested with current GF. 2015-11-11 13:30:21 +00:00
aarne
a4919b6c94 moved old ios-swift files to the subdirectory src/ui/ios/old-swift 2015-11-11 10:56:22 +00:00
aarne
6cb2526253 AppEst was missing from darcs, oops 2015-11-11 09:40:35 +00:00
aarne
5e4e78097d added Estonian to the Android app 2015-11-09 13:32:57 +00:00
aarne
435f04b27f small fixes in Est translation and app.probs 2015-11-09 12:44:19 +00:00
kaljurand
0b1a880eae better Estonian Phrasebook modules from https://github.com/GF-Estonian/GF-Estonian 2015-11-09 12:43:29 +00:00
aarne
a57eddf1df last fixes to make AppEst compile 2015-11-09 11:02:09 +00:00
aarne
73861c2993 started Estonian phrasebook modules to test AppEst 2015-11-09 10:43:24 +00:00
aarne
ce6557f1f2 the visualization commands (aw,vd,vp,vt) can now show multiple trees. Previously they only showed one tree even if there were for instance after ambiguous parsing. The reason was that dot (graphviz) ignored all graphs but the first one. Now the graphs are put into separate files. The 'convert' command from ImageMagick package is used to combine them to one pdf. If this is a problem, the old behaviour can be restored by the -number=1 option to the tree-generating command, which cuts away all trees but the one and doesn't require ImageMagick. 2015-11-05 16:47:41 +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
e8b5b8c390 Fix bug in gf -server mode with /gfshell requests not updating the state of the shell
The test for the quit command had the wrong polarity.
The problem was reported by Fahime Ghasemi on gf-dev mailing list.
2015-10-28 15:03:19 +00:00
krasimir
46fc386cfb bugfix for lookupMorpho in the C runtime 2015-10-14 07:36:46 +00:00
hallgren
8f23e37fe2 gf.cabal: require base>=4.5 (ghc>=7.4)
There are some low-level dependencies in GF.Text.Coding that break
compatibility with older versions of GHC and some other known problems.
2015-10-07 14:57:01 +00:00
hallgren
3a3963206b Update PGF API documentation link on home page, bump version number in gf.cabal to 3.7.1-darcs 2015-10-05 12:38:23 +00:00
hallgren
5c933bd4cf Setup.hs: fix off-by-one error the change count in the version info
The difference between "One change" and "No changes" is very noticeable.
2015-10-02 11:46:29 +00:00
hallgren
1b2dfbb6d8 Bump version number to 3.7.1 and finalize documentation
Updated version number in gf.cabal and update debian/changelog
News item on home page (index.html)
Some last minute edits on the download page
Move the new release notes and download page in place.
2015-10-02 10:15:02 +00:00
hallgren
beccb68ddd GF.Interactive2: extension FlexibleContexts is needed for GHC 7.10 compatibility 2015-10-02 09:59:55 +00:00
hallgren
35a237d8cf Minor edit of GF 3.7.1 release notes 2015-10-02 09:34:20 +00:00
hallgren
42f7b77708 Some work on the release notes and download page for GF 3.7.1. 2015-10-01 12:57:31 +00:00
hallgren
3c90f664f7 bin/build-binary-dist.sh: fix hardcoded /usr install path for .pkg packages. 2015-10-01 12:49:55 +00:00
hallgren
f89cf16d25 Makefile: make pkg: change install location from /usr to /usr/local
...for compatibility with OS X 10.11 El Capitan (which was released yesterday)
2015-10-01 08:39:35 +00:00
hallgren
13a8515164 cc -trace: don't try to show the bodies of lambda abstractions
This triggers evaluation of terms with free variables, which the partial
evaluator isn't equipped to handle.

Reported by Aarne.
2015-09-30 10:30:19 +00:00
krasimir
5faa99e89d added bracketedLinearizeAll in Python 2015-09-30 08:35:09 +00:00
hallgren
bd421aff7b download/release-next.t2t: preliminary release notes for GF 3.7.1
To be released as soon as possible...
2015-09-29 20:15:51 +00:00
hallgren
1ccdd0d9fd GF source lexer: allow numeric character escapes in string literals
This makes the output from PGF.showExpr (and other Haskell code that uses
the Prelude.show function to show strings) parsable as GF source code in
more cases.

This is a workaround for the problem that GHC's implementation of the show
function uses numeric escapes for printable non-ASCII characters, e.g.
show "dålig" = "d\229lig"...
2015-09-29 12:18:35 +00:00
hallgren
35be182824 Preliminary new shell feature: cc -trace.
You can now do things like 

	cc -trace mkV "debug"

to see a trace of all opers with their arguments and results during the
computation of mkV "debug".
2015-09-28 22:23:56 +00:00
hallgren
82f238fe2b haskell-bind/SG.hsc: fix unsafePerformIO import problem with ghc>=7.8 2015-09-14 11:42:42 +00:00
hallgren
af309f0d7d doc/gf-developers.t2t: script name for installing the C run-time was wrong, should be setup.sh 2015-09-14 11:19:29 +00:00
hallgren
b66cbcac5e doc/gf-developers.t2t: some updates 2015-09-14 09:24:10 +00:00
hallgren
95d2b67556 WebSetup.hs: always enable parallel compilation of the RGL and the example grammars
This should work nicely now that GF itself can detect the number of processors
in the system.

Previously there was some code in WebSetup.hs that relied on Cabal to do this,
but it was commented out because it requires Cabal>=1.20, which is fairly new
and it would complicate the installation instructions if it was required to
compile GF...
2015-09-11 15:15:53 +00:00
hallgren
bde7347045 Remove debug output introduced in previous patch
Oops.
2015-09-11 14:46:31 +00:00
hallgren
9556cf453f Parallel compilation: "gf -make -j" and "gf -make -j=n" now work as expected
* "gf -make -j=n" uses n parallel threads.
  * "gf -make -j" adapts to the number of processors in the system.

This mimics how "cabal build -j" and "ghc --make -j" works.

Support for this is implemented in the new module GF.System.Concurrency and
it depends on the function Control.Concurrent.setNumCapabilities, which is
only available in GHC>=7.6 (base>=4.6). GF can still be compiled with
GHC<7.6, but then you have to use +RTS -N -RTS to take advantage of
multicore processors.

To detect the number of processors in the system, the code depends on a
foreign import of a C function in the GHC run-time system.
2015-09-11 14:18:01 +00:00
krasimir
ef888baec8 fix the debug mode in the tree generator in the C runtime 2015-09-11 09:26:17 +00:00
hallgren
e5ec343f4f 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
hallgren
fe3dfd7cc4 example/foods/FoodsIce.gf: converted from Latin-1 to UTF-8 encoding 2015-09-10 12:37:12 +00:00
krasimir
d83316d7c6 add readTriple in the Haskell binding 2015-09-08 13:04:31 +00:00
krasimir
b5e7f08c82 bugfix in the parser 2015-09-08 09:42:42 +00:00
krasimir
ea83efa79c fix the metadata for sg databases 2015-09-04 16:34:40 +00:00
krasimir
3d60ce06bb storage for literals in libsg 2015-09-04 14:45:18 +00:00
thomas
76e4e65337 src/pgf-binary: reimplementation of GF's customized Data.Binary on top of the standard binary packages
This reduces the amount of duplicated code from 2400 to 490. No code from
data-binary-ieee754 is duplicated.

The module is called PGF.Data.Binary instead of Data.Binary. It is not
in use yet.
2015-09-04 12:58:29 +00:00
krasimir
206e38028f libsg is now accessible on android 2015-09-04 11:18:21 +00:00
krasimir
8cc7ccf80b API for triple queries from Java 2015-09-04 11:03:46 +00:00
krasimir
0b392e8cff the Haskell binding now covers everything in the libsg API 2015-09-04 10:02:42 +00:00
krasimir
e9f7aa0e33 the new triples API in libsg now always works with expressions 2015-09-04 10:01:19 +00:00
hallgren
32f18b515e GF shell: write_file now writes one tree per line
This compensates for other changes that removed line breaks.
Maybe it should have a -lines options like ps and rf?
2015-09-03 20:42:38 +00:00
hallgren
829e1bbfd3 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
3328dd1f8d Java API for opening/closing SG databases 2015-09-03 13:52:32 +00:00
krasimir
c322e686a0 bugfixes in libsg 2015-09-03 13:24:13 +00:00
krasimir
7064181860 the Eclipse project for the Java binding is now replaced with a simple Makefile 2015-09-03 10:27:50 +00:00
krasimir
e97e377b05 silence compilation warnings in the Java binding 2015-09-03 10:11:23 +00:00
krasimir
ef90fa4abe API for transactions in libsg 2015-09-02 13:01:23 +00:00
krasimir
73b41687c8 added the minimal Haskell API for storing expressions/triples in the semantic graph 2015-09-02 07:12:36 +00:00
krasimir
4a1da62d84 bugfix in libsg 2015-09-02 06:55:39 +00:00
hallgren
0449784427 Wide coverage translation demo: make it easier to use with different grammars 2015-09-02 14:44:30 +00:00
krasimir
66454d844a added code for visualization of the sematic graph in the app. The code is there but the menu item for activating it is not there yet since the functionality is not complete 2015-09-01 08:00:56 +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
krasimir
9a58afe121 still partial implementation for complex queries in libsg, and added sg.h which I had forgotten to include in darcs 2015-08-31 07:15:20 +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
krasimir
f2952768d5 query for triples and cleaner API 2015-08-27 15:18:51 +00:00
hallgren
128236eab9 GF shell: change parse & linearize to obtain useful results from p|l and l|p 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-26 13:56:23 +00:00
krasimir
32d5d4b52f added libsg in the C runtime 2015-08-24 09:36:51 +00:00
krasimir
e43608eca0 retrieval of a triple 2015-08-21 16:31:43 +00:00
krasimir
17a572dda6 API for storing triples in the semantic graph 2015-08-21 16:13:03 +00:00
hallgren
c25705519a GF shell bug fix: visualize_parse didn't accept the -lang flag
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-21 12:20:40 +00:00
hallgren
e178615338 GF -cshell: implement visualize_parse
Supported options and flags: -lang -format -view
None of the rendering options available in the Haskell run-time are supported.
2015-08-21 12:14:47 +00:00
krasimir
d1b46ece28 add a type signature in GF.Interactive2 to make ghc-7.6.3 happy 2015-08-21 11:58:32 +00:00
hallgren
026d6a73ad gf -cshell: implement visualize_tree
But the following options are not supported: -mk -nocats -nofuns
2015-08-21 10:14:46 +00:00
hallgren
786ef54d62 gf -cshell: implement a subset of print_grammar and abstract_info
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-20 16:06:10 +00:00
hallgren
330d42296c 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
krasimir
2f9704a624 add the initial sketches of the semantic graph storage 2015-08-20 13:31:43 +00:00
hallgren
2ff7e829dc gf -cshell: linearize: implement options -all -list -treebank
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-18 16:05:45 +00:00
hallgren
41075fb50a GF shell: restore the eh command to working order and document it
Also, when the command line parser fails, append the problematic command line
to the error message "command not parsed".
2015-08-18 13:13:31 +00:00
hallgren
17e7a01ae1 GF shell: add the start options to GFEnv, turn "reload" into an ordinary command 2015-08-17 15:56:39 +00:00
hallgren
2df2d4a683 GF Shell: "ph | wf -file=foo.gfs" now works as advertised
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-13 15:30:23 +00:00
hallgren
87e64a804c GF Shell: refactoring for improved modularity and reusability:
+ 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-13 10:49:50 +00:00
hallgren
d860a921e0 GF Shell: turn set_encoding into a common command
Implemented in GF.Command.CommonCommands instead of GF.Interactive &
GF.Interactive2.
2015-08-12 15:00:03 +00:00
hallgren
b536b02534 GF.Interactive2: cleanup 2015-08-12 12:33:36 +00:00
krasimir
8e39c1f622 Bugfix in the android app for Chinese which was causing the first character in the translation to disappear 2015-08-12 18:44:45 +00:00
hallgren
6fff2def39 GF shell: source commands (cc, sd, so, ss & dg) can now be used in pipes
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-12 11:05:08 +00:00
hallgren
063912c386 Move welcome message from GF.Interactive & GF.Interactive2 to GF.Command.Messages
...to avoid the duplication.
2015-08-12 11:01:45 +00:00
hallgren
e50f92c41d GF shell: make environment types abstract, comment out some dead code 2015-08-11 16:14:38 +00:00
krasimir
6b90024d09 pickling/unpickling for types 2015-08-12 10:11:00 +00:00
krasimir
ac6ce58777 support for transparent pickling/unpickling of abstract expressions in Python 2015-08-12 09:21:23 +00:00
hallgren
911310bb40 gf -cshell: improved help for the 'import' command 2015-08-10 16:39:31 +00:00
hallgren
666945a7b0 Forgot to include gf.cabal in previous patch 2015-08-10 16:38:28 +00:00
hallgren
10e7bacbfd Factor out common code from GF.Command.Commands and GF.Command.Commands2
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-10 16:30:17 +00:00
hallgren
8d6e61a8df 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
hallgren
d38efbaa6a Refactor GF shell modules to improve modularity and reusability
+ 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-10 13:01:02 +00:00
krasimir
20644d0299 bump the version number for the Android app 2015-08-10 08:34:29 +00:00
krasimir
a33e06649d now the app shows the correct abstract syntax names for unknown words while it still produces the right TTS 2015-08-06 14:19:13 +00:00
krasimir
26c2f12170 another fix in the Thai keyboard 2015-08-06 14:18:49 +00:00
hallgren
ac9e86f5f2 GF Home Page: Updated the link to the Haskell API, and a couple of other links 2015-08-06 14:07:18 +00:00
krasimir
336128309b disable the visualization of glosses in the App until we have a complete database 2015-08-06 13:02:27 +00:00
krasimir
3f90b8305a set the optimization levels for the JNI code to release level 2015-08-06 13:01:07 +00:00
krasimir
9b0cb5adad bugfix for the word prediction in the App 2015-08-06 12:51:42 +00:00
krasimir
266fe48aa8 a better layout for the Thai keyboard 2015-08-06 12:23:27 +00:00
krasimir
f6796ced2d bugfix in lookup_morpho in the C runtime 2015-08-06 11:51:23 +00:00
hallgren
7736ba5694 Update doc/gf-help-full.txt (GF shell reference manual) 2015-08-04 11:49:17 +00:00
hallgren
8c1c29b829 FoodsTur.gf: use Predef.BIND instead of "&+"
...for better results when used with the C run-time system.
2015-07-28 10:58:00 +00:00
aarne
a1a602c681 rewrote an mkPN application in WordsGer to work around a problem that might be a type checker bug 2015-07-23 16:16:38 +00:00
hallgren
3788098e0a Setup.hs: ignore .* instead of . and .. when compiling/copying all files in a directory
This avoids problems with .DS_Store files created by the Finder on OS X.
2015-07-22 14:34:02 +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
aarne
55e2a4c9cb added PassV2 to App; PassVPSlash did not work as VPSlash was disabled for speed reasons 2015-07-21 13:01:29 +00:00
aarne
db23eec58e removed the obsolete examples/translator directory, which caused confusion 2015-07-20 14:32:50 +00:00
hallgren
400195b307 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
krasimir
880f0a63d0 make the virtual machine instructions more uniform 2015-07-16 15:43:18 +00:00
krasimir
d22c07dcfb refine the GNU lightning patch to avoid generating unnecessary code 2015-07-16 15:29:14 +00:00
krasimir
fac48d43e8 bugfixes in the JIT compiler for x86_64. One of the fixes is actually in GNU lightning 2015-07-16 15:21:09 +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
f994d556e0 Wide Coverage Demo: avoid errors if d3 or d3Tree can't be loaded 2015-07-15 14:07:26 +00:00
krasimir
4810a0b8e5 add the Python API tutorial to the GF home page 2015-07-15 12:12:50 +00:00
krasimir
aa6b6d3155 fixed missing do in the Haskell binding 2015-07-12 15:37:45 +00:00
krasimir
192b1cc018 the reasoner's states are now closures just like the code for the def rules. This means more compact JIT compiled code and uniformity with the code for def rules 2015-07-04 15:06:34 +00:00
krasimir
b3680b6025 merge the states for reasoning and evaluation into a single structure 2015-07-03 11:53:52 +00:00
krasimir
1c2b6702d7 merge brassiere_1_N/brassiere_2_N and aborigine_N/aboriginal_N 2015-07-01 11:14:48 +00:00
krasimir
7daf119cbc forgot to add the DBManager 2015-07-01 09:51:01 +00:00
krasimir
34ef01f613 the Android app now can show Glosses from WordNet 2015-07-01 09:44:56 +00:00
krasimir
fa13e1834c specify strict APP_PLATFORM to avoid crashes on devices with older android version 2015-06-30 22:14:12 +00:00
krasimir
22773909bf add function 'functions' in the Haskell binding to the C runtime 2015-06-30 20:42:19 +00:00
krasimir
e6ddb7a578 some more comments in the help page 2015-06-30 17:01:56 +00:00
krasimir
789c35bd0c bugfix in the Android keyboard 2015-06-30 16:51:22 +00:00
krasimir
4d33dfd698 better layout for the Thai keyboard 2015-06-30 15:54:14 +00:00
krasimir
a2bf81a2ca increase the version number for the app 2015-06-30 13:53:57 +00:00
krasimir
5b0f7d81cc added ant.properties in the App folder to make it easier to prepare releases 2015-06-30 13:53:09 +00:00
krasimir
6f2afdd53e bugfix in the parser for lexical lookup 2015-06-30 12:54:19 +00:00
hallgren
21df1ed2f5 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
c90c8afca5 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
2643f3cee6 Documentation updates for the release of GF 3.7 2015-06-25 12:10:47 +00:00
krasimir
c7f1803410 bugfix in the bottom-up prediction for the parser 2015-06-25 09:46:43 +00:00
hallgren
c6cdb66cf2 runtime/c/pf/jit.c: silence warning about alloca on MINGW32 2015-06-23 15:49:31 +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
hallgren
984c09923c WebSetup.hs: a note about parallel builds 2015-06-23 10:22:35 +00:00
hallgren
72237e6fff 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
e340b415c7 Remove the automatically generated doc/gf-developers.html 2015-06-22 15:10:37 +00:00
krasimir
c515d7c4dc three more points in the release notes 2015-06-17 13:08:03 +00:00
krasimir
2f2f459a89 forgot changes in the serialization in the Haskell runtime 2015-06-17 12:58:46 +00:00
krasimir
e352742b8c the orthographic tokens were broken when they appear inside a dictionary entry. Now this is fixed by treating those as syntactic rules 2015-06-12 13:03:19 +00:00
hallgren
6302d982ff 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
krasimir
ac01e5019a fixed typo in the Haskell runtime 2015-06-11 07:41:28 +00:00
aarne
5f5db10714 updated Android helpfile 2015-06-09 09:32:11 +00:00
aarne
4b044566a4 note on official vs development version of the Android app 2015-06-09 09:28:39 +00:00
aarne
ceba45af5e updated demos/app.html 2015-06-09 09:22:59 +00:00
krasimir
9b0edaacdb print error message for missing abstract categories in the C runtime 2015-06-05 07:41:59 +00:00
aarne
93bde37a97 AppFre.pgf added to repo by mistake, now removed 2015-06-02 13:21:55 +00:00
aarne
3643e20406 copied examples/app to examples/slowApp; the new app is a bit scaled down but much faster 2015-06-02 12:59:29 +00:00
aarne
eb07e4e862 French input grammar FreInput separated from Fre 2015-06-02 09:45:44 +00:00
aarne
212bfd7acc an input grammar for French - 40 times faster, makes all the difference in the app! 2015-06-02 09:13:15 +00:00
hallgren
f763074eec 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
75aa394dc1 minibar: moved 2 reusable functions from minibar_translations.js to minibar_support.js 2015-05-27 13:28:40 +00:00
hallgren
baf9fc576c examples/phrasebook/Makefile2: include Jpn and Snd in the build 2015-05-21 15:01:27 +00:00
hallgren
a7e8a566cf 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
8039633528 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
a37d792d14 minibar: cosmetic fix for the "To:" menu 2015-05-19 14:26:39 +00:00
hallgren
1018171bca minibar: more work on speech output 2015-05-19 13:38:42 +00:00
krasimir
786da46a99 added callback in C for unknown words 2015-05-19 09:15:48 +00:00
krasimir
616a24cba4 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
hallgren
1edd58fff8 minibar: speech output (experimental) (in browsers that support it) 2015-05-18 15:58:57 +00:00
hallgren
011e980e9d minibar: use SVG instead of PNG for trees and alignment diagrams if supported by the browser 2015-05-18 14:54:29 +00:00
krasimir
09a57b34a8 bugfix in the NERC in C 2015-05-18 15:02:44 +00:00
krasimir
ce05465365 the callbacks in C now take the concrete syntax as a parameter 2015-05-18 14:41:33 +00:00
krasimir
773a33979b pgf_lookup_morpho and pgf_lookup_word_prefix are now also case insensitive if case_sensitive=off 2015-05-18 14:20:35 +00:00
hallgren
9d21b73a81 GF cloud: updated lists of supported RGL languages and some minor style updates 2015-05-18 13:16:45 +00:00
krasimir
b4e41cabdd "flags case_sensitive=off" makes the parser case insensitive 2015-05-11 14:11:42 +00:00
krasimir
1e0d7be4f4 added all orthographic primitives 2015-05-11 13:01:39 +00:00
krasimir
13998e3287 implemented CAPIT in parsing 2015-05-08 18:54:50 +00:00
krasimir
483df35954 fix in the dictionary lookup 2015-05-08 18:12:24 +00:00
krasimir
ea0f74d455 a new nice and elegant algorithm for dictionary lookup in the parser 2015-05-08 14:38:24 +00:00
krasimir
365c7bb1d8 the parser is now fully Unicode compatible 2015-05-08 09:23:29 +00:00
krasimir
b961e9a255 fix gu_ucs_is_space in libgu 2015-05-07 15:50:55 +00:00
krasimir
bf3b6f2794 fix the NERC in C to work for PN as literal 2015-05-07 15:16:55 +00:00
krasimir
7e43e5727a fix pgf-translate to use the NERC again 2015-05-07 14:49:30 +00:00
krasimir
01c4836d4d fix the UTF8 implementation in libgu 2015-05-06 15:51:12 +00:00
hallgren
c1265db3a7 GF.Haskell: small pretty printing improvement 2015-05-05 14:06:20 +00:00
hallgren
b0e8a49b9a 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
krasimir
3649412ce2 use a temporary pool for linearizeAll in Haskell too 2015-04-27 19:39:16 +00:00
krasimir
82eeb3ef2b fix a memory management error in linearizeAll in the python binding. a new temporary pool is used on every iteration to keep memory allocation to constant 2015-04-27 19:27:11 +00:00
krasimir
c1129e15fa fix warning in the Python binding 2015-04-27 18:33:18 +00:00
krasimir
5f25804b73 mark two more functions as static in the Python binding 2015-04-27 18:24:21 +00:00
krasimir
fc4b39d65f make linearizeAll in the Haskell binding lazy 2015-04-27 16:28:45 +00:00
prasanth.kolachina
8efff76703 K translations in pipeline 2015-04-27 15:59:49 +00:00
prasanth.kolachina
53f0307404 K Linearizations 2015-04-27 15:59:25 +00:00
prasanth.kolachina
dedad558a8 Python linearizeAll with lazyness
linearizeAll function will take an expression and an optional
n keyword argument and return an iterator to the n-variant 
linearizations of the expression.
2015-04-27 15:47:57 +00:00
prasant.kolachina
9b723af995 remove parsing for long sentences, to stop pipeline from crashing/hanging 2015-04-27 13:05:14 +00:00
prasant.kolachina
2555891654 bug fix in python examples 2015-04-26 11:00:17 +00:00
prasant.kolachina
3ec571b03d bug fix python examples 2015-04-26 10:18:21 +00:00
prasant.kolachina
aa79f6bb28 Bug fix python examples 2015-04-26 10:16:23 +00:00
prasanth.kolachina
c17501540a Changes in lexer 2015-04-26 07:44:18 +00:00
prasanth.kolachina
100c583916 Bug fix in gf_utils 2015-04-24 18:46:03 +00:00
prasanth.kolachina
7d876fd665 No debug messages 2015-04-22 18:51:55 +00:00
prasanth.kolachina
12216449e0 Minor bug in pgf parse and kparse 2015-04-22 18:49:49 +00:00
prasanth.kolachina
57006b6296 README for Python translation pipeline 2015-04-22 13:14:26 +00:00
prasanth.kolachina
c3a626686e Cleaned up Python Translation pipeline 2015-04-22 11:30:26 +00:00
prasanth.kolachina
2b1b0568a1 Examples for using Python bindings
The examples directory contains two modules for using Python bindings in GF.
The gf_utils module provides various Python functions to perform parsing
and linearization using the C runtime. Additionally, the translation_pipeline
module is an replica of the current pipeline used in the Wide-coverage
Web translation pipeline.
2015-04-22 07:04:21 +00:00
aarne
2804160f07 some translate.probs decreased ; fine-tuning in pgf-hsbind-trans 2015-04-21 14:13:13 +00:00
krasimir
27bd12ce67 forgot to update gf.cabal 2015-04-20 12:25:52 +00:00
krasimir
8c697b72a4 drop the dependency to FST 2015-04-20 11:56:13 +00:00
krasimir
5d7633fdb4 added getpagesize() definition for Windows 2015-04-20 09:57:28 +00:00
krasimir
aebc868c22 fix in the Haskell binding for Windows 2015-04-20 09:55:15 +00:00
aarne
0add1bdb20 pgf-hsbind-trans now with linearizeAll 2015-04-17 14:33:28 +00:00
hallgren
78a34bc52b pgf-shell.hs: remove call to performGC and document the 'i' command 2015-04-17 13:34:41 +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
krasimir
86e16d9e3d added linearizeAll in the Haskell bindings 2015-04-17 12:33:22 +00:00
krasimir
4221757895 bugfix in the java binding 2015-04-16 13:53:03 +00:00
aarne
a5305f1d9f simplified the example translator and renamed it to pgf-hsbind-trans 2015-04-16 13:51:18 +00:00
hallgren
1420e35cbb 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
aarne
2ceeea17fd lower probability for chunked phrases 2015-04-16 11:39:28 +00:00
aarne
e2175a31ce restored Cantonese as app Chi speech output: nothing else seems to work 2015-04-16 06:52:09 +00:00
aarne
b908b2ba3f extended pgf-shell functionalities: batch translation with many trees, and intervening context-dependent tree manipulation 2015-04-15 15:53:44 +00:00
hallgren
8cfb989c9c 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
aarne
9aeffa15c9 updated app help file ; added backslash to ? in Thai keyboard xml to make it compile 2015-04-13 09:45:05 +00:00
hallgren
71de9a26ef 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
d249538469 GF.Compile.ConcreteToHaskell: some documentation 2015-04-07 14:51:52 +00:00
hallgren
6e81383231 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
12f5dc9ece 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
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
2041578406 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
e475fb1091 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
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
99f87c30d0 haskell-bind: add bindings to graphviz rendering functions for abstract&parse trees 2015-03-19 14:14:30 +00:00
krasimir
e72fcb1513 fix the compilation of gu/mem.c on Windows. For now memory mapped pools on Windows are just not supported. 2015-03-19 09:28:31 +00:00
hallgren
a120ed1e22 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
aarne
1c1e6bf005 Mongolian on index page 2015-03-13 15:24:10 +00:00
aarne
8ac46d55f7 added Nepali to Setup: it had been missing 2015-03-13 15:10:16 +00:00
aarne
0f18e65b5e added Afrikaans to Setup: it had been missing for a while 2015-03-13 15:08:03 +00:00
aarne
8fcfc49fed updated Setup and RGL status.html with Mongolian: now it compiles by default 2015-03-13 14:51:01 +00:00
hallgren
421bdf3903 GF.CompileInParallel: fix a Win32 problem
Recognize \ in addition to / when extracting path components.
2015-03-13 13:48:14 +00:00
hallgren
cd50599267 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
748ebae433 GF.Server: request logging: increase length limit from 100 500 chars per field 2015-03-11 15:56:06 +00:00
aarne
1508fc764d DictionarySwe: kick_V2, mouse_N 2015-03-11 08:08:38 +00:00
krasimir
8f0624bc30 remove the meta_item variable from the parse state 2015-03-06 15:18:50 +00:00
hallgren
4c03e2e67d 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
4e4d2a77e1 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
krasimir
0238579610 remove some more old code 2015-03-05 14:47:36 +00:00
krasimir
7539809461 removed some operations in GeneratePMCFG. They didn't work well with variants and are now obsolete with the new partial evaluator 2015-03-05 13:58:18 +00:00
hallgren
854fec6d3a 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
814c80124b GF.Compile.Compute.ConcreteNew: some refactoring for readability 2015-03-04 13:30:11 +00:00
hallgren
6480620e1d 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
632aab83c3 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
e0bc6308e0 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
d3f6b9851f gf.cabal: adjust version constrains on the network, cgi and httpd-shed packages 2015-02-25 18:41:57 +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
krasimir
a5817ff492 fix some out-of-date code for the PGF_RESULT_DEBUG mode in the parser 2015-02-26 13:31:26 +00:00
krasimir
9c83b2e27d use the same trick for comparison of doubles in cmp_expr_state 2015-02-26 13:10:01 +00:00
krasimir
532647c978 bugfix in the parser which caused some items to be poped in the wrong order if their probability differ with less that 0.5 2015-02-26 12:17:59 +00:00
hallgren
52212d5a76 Wide Coverage Translation Demo: better resizing behavior on startup and when pasting text 2015-02-25 15:36:25 +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
krasimir
715ac1ca62 remove three more uses of meta productions that were left in debugging mode 2015-02-24 10:59:18 +00:00
krasimir
da11a7127f implemented escape characters when reading/printing an abstract expression with string literals 2015-02-24 09:35:12 +00:00
krasimir
218c6be0a7 fix in thai_page2.xml 2015-02-20 15:31:32 +00:00
hallgren
2c617e6cf9 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
krasimir
70a71a6f0e set the keyboard pages for Thai in Translator.java 2015-02-20 14:26:30 +00:00
krasimir
b864601cb9 experimental Thai keyboard (still not tested) 2015-02-20 14:08:12 +00:00
joel.hinz
2394763daa translation app for iOS, replicating some of the functionality of the Android app. Compiles and works on iPad retina but may crash and has known issues. 2015-02-20 07:47:43 +00:00
krasimir
f848857519 added option -plus-as-bind which treats (+) as a bind when used with runtime variables 2015-02-20 13:26:12 +00:00
krasimir
8fae104957 remove the meta prob flags 2015-02-20 13:00:51 +00:00
hallgren
9f70eaa13c 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
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
krasimir
e893d41393 silence some warnings in GNU Lightning for i386_64 2015-02-19 12:53:52 +00:00
krasimir
b92bbcfc37 parsing with meta rules is now removed since we don't use them anymore and I would gladly remove some code. 2015-02-19 11:59:51 +00:00
krasimir
39bbe68adf 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
f3797bb313 fix the callback for unknown words as well 2015-02-18 16:47:33 +00:00
krasimir
a97dee067a fix in the callback for names in the Haskell binding 2015-02-18 16:41:13 +00:00
krasimir
e3a87c657b fix in the parser for callbacks in the middle of a word 2015-02-18 16:14:29 +00:00
hallgren
24232004f0 Wide Coverage Translation Demo: use App14.pgf, remove spaces from Chi, Jpn and Tha output 2015-02-18 13:58:49 +00:00
aarne
4ea4d035dd removing spaces from App output of Chi,Jpn,Tha to get nicer speech output (and of course follow the target lang conventions) 2015-02-17 18:11:20 +00:00
aarne
818a119a5b App14 with Tha up and running! 2015-02-17 17:18:51 +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
efb1b540f4 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
63f79fb250 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
kr.angelov
d361b7f5d2 fix in the JIT compiler that would hopefully make it work on iOS 2015-02-11 13:07:06 +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
aarne
3509ee650d news on Summer School on the main page 2015-02-09 09:35:51 +00:00
kr.angelov
68a2f09590 added hasLinearization in the Haskell binding 2015-01-30 13:05:57 +00:00
aarne
340328b8a1 Phrasebook compiled for Japanese; weather_N in DictionaryGer 2015-01-27 13:18:44 +00:00
aarne
0d8e73847c added Japanese to Android app. Had to change target=android-20 to 21. 2015-01-21 22:20:25 +00:00
hallgren
c398b1e794 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
6b55ad88d4 PGF2: fixes for named entity callback function 2015-01-21 13:54:48 +00:00
hallgren
6ddef21dea examples/phrasebook/Makefile: include Jpn in 'make forApp' 2015-01-21 12:16:57 +00:00
hallgren
ffe1f74584 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
kr.angelov
790738c82b fix conflicts 2015-01-21 08:35:20 +00:00
kr.angelov
79f8ab695c added functionType in the Haskell API to the C runtime 2015-01-20 14:45:02 +00:00
hallgren
3f3df9a719 PGF2 & PGFService: work in progress on callbacks for nerc & chunks 2015-01-20 14:57:52 +00:00
hallgren
1fa59f7554 PGF2: introduced some type synonyms to make type signature more readable 2015-01-20 12:57: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
john.j.camilleri
e128139e8c Change minibar URL to cloud.gf.org in QuickStart page 2015-01-19 06:45:15 +00:00
aarne
6ba8851cc8 AppJpn.gf and a Makefile entry for App13 which includes Japanese. Everything compiles now. But Japanese has no support for chunks, because ChunkFunctor does not typecheck for it due to its richer Utt type. 2015-01-14 17:22:47 +00:00
hallgren
507b52cc23 gf.cabal: include PGF.Haskell 2015-01-14 14:53:28 +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
hallgren
2e642ace8a 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
lizazim
68b4bb74cc patchJpn 2015-01-07 23:44:49 +00:00
hallgren
ef84f7d842 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
0694a915d2 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
cbd873839b 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
kr.angelov
35c11d5f5a fix the reference counting for callbacks in Python 2015-01-05 11:24:00 +00:00
kr.angelov
3bd40dbab6 API for word alignment in the C runtime and in the Haskell binding 2014-12-29 10:59:20 +00:00
kr.angelov
8fd24c3839 more compact implementation for GuStringBuf 2014-12-24 14:20:30 +00:00
aarne
537bc249f9 lowered Symb_Chunk probability; fixed translator Makefile 2014-12-19 15:17:38 +00:00
kr.angelov
13f4af4910 bugfix and tiny optimization for callbacks from Haskell 2014-12-19 10:14:41 +00:00
kr.angelov
856683f79f haddock comments for parseWithHeuristics 2014-12-19 09:05:51 +00:00
kr.angelov
f44f9a1b00 added mkStr to the Haskell binding 2014-12-19 08:58:02 +00:00
kr.angelov
bb1c1dd27c added mkApp to the Haskell binding 2014-12-19 08:47:00 +00:00
kr.angelov
6b2ef03af9 fix in the Haskell binding 2014-12-16 10:35:56 +00:00
kr.angelov
990dce35ae forgot to export parseWithHeuristics from Haskell 2014-12-16 10:33:45 +00:00
kr.angelov
9bc5349e62 change in the API for literals
The API in the C runtime as well as in the Haskell, Python and Java binding
is changed. Now instead of adding the literal callbacks to the concrete syntax
you need to supply them every time when you need to parse. The main reason is:

- referentially transparent API for Haskell
- when we start using memory mapped files we will not be allowed to change
  anything in the grammar data structures. At that point the old API would
  be impossible to use.
2014-12-16 10:21:26 +00:00
hallgren
d98bd34a33 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
9235f49ab3 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
kr.angelov
02df25d4b6 bump the version code in AndroidManifest.xml 2014-12-11 23:29:58 +00:00
hallgren
75338503a9 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
kr.angelov
3e8e477652 update the nerc for the changes in the grammar 2014-12-11 21:54:34 +00:00
aarne
a7b22188c1 updates in app help file, e.g. the app name 2014-12-11 20:05:57 +00:00
hallgren
2eaf46f610 Work in progress on translating linearization functions to Haskell
The translation is currently good enough to translate all concrete syntaxes
of the Foods and Letter grammars, and some concrete syntaxes of the Phrasebook
grammar (e.g. PhrasebookEng & PhrasebookSpa works, but there are problems with
e.g. PhrasebookSwe and PhrasebookChi)

This functionality is enabled by running

	gf -make -output-format=haskell -haskell=concrete ...

TODO:
	- variants
	- pre { ... }
	- eta expansion of linearization functions
	- record subtyping can still cause type errors in the Haskell code
	  in some cases
	- reduce code large tables
2014-12-11 16:08:36 +00:00
hallgren
9be0c21676 GF.Grammar.Macros: generalize the type of collectOp
New type:

    collectOp :: Monoid m => (Term -> m) -> Term -> m
2014-12-11 16:05:42 +00:00
hallgren
719f926a48 GF.Server: remove some code duplication 2014-12-11 15:58:57 +00:00
kr.angelov
709163c32e back to familiar you in Hindi 2014-12-11 16:13:55 +00:00
kr.angelov
8bf2c9ecbb update gf-translator.svg 2014-12-11 13:44:48 +00:00
kr.angelov
7d87339b52 edit the presentation image 2014-12-10 13:33:28 +00:00
kr.angelov
a2fb1bf5f2 rename HLCompiler to GFTranslator 2014-12-10 13:21:18 +00:00
kr.angelov
166402f7e5 added presentation image for the app 2014-12-10 13:14:11 +00:00
kr.angelov
4c83d98381 make the GF logo fit precisely in a square 2014-12-10 10:29:27 +00:00
kr.angelov
81fda41fbc make sure that the app doesn't crash even if nonExist is used somewhere in the grammars 2014-12-09 12:31:36 +00:00
kr.angelov
e41ec32ba9 make sure that neither I nor I'm is recognized as name in English 2014-12-09 08:49:22 +00:00
kr.angelov
386ec87405 bugfix for unknown words 2014-12-08 19:38:03 +00:00
hallgren
676b0d6e81 Haddock documentation: expose exportPGF, some other small improvements 2014-12-08 14:48:14 +00:00
kr.angelov
55e2b55e60 restore the visualisation of abstract trees from the app 2014-12-08 16:17:42 +00:00
kr.angelov
d4b8281226 fix for the unknown words 2014-12-08 15:42:14 +00:00
kr.angelov
42d73f0d10 fix typo 2014-12-08 15:36:07 +00:00
kr.angelov
31f835a6c8 register the callback for the Symb category 2014-12-08 15:22:33 +00:00
kr.angelov
3fd53b907e added a callback for unknown words 2014-12-08 15:18:01 +00:00
aarne
8ec5910ae2 probabilities for new chunk rules ; Symb as another literal in app Makefile 2014-12-08 10:20:06 +00:00
aarne
fae9df2517 some edits in app help file 2014-12-07 17:42:47 +00:00
aarne
82a7e22d2e MissApp.hs: a function for preparing a list of lin rules for missing words 2014-12-06 08:39:25 +00:00
aarne
52d3839271 a script for analysing missing functions, e.g. "which functions of type Quant are missing in each language" 2014-12-05 17:01:58 +00:00
hallgren
fc46db8c7f Eliminate the record extension operator from the Value type returned by the partial evaluator
It was used only in cases where a lock field needed to be added to a
run-time variable, like e.g. in examples/phrasebook/SentencesTha.gf: 

    lin
      PGreetingMale g   = mkText (lin Text g) (lin Text (ss "ครับ")) | g ;
      PGreetingFemale g = mkText (lin Text g) (lin Text (ss "ค่ะ")) | g ;

But lock fields are only meaningful during type checking and can safely be
ignored in later passes.
2014-12-05 12:42:17 +00:00
aarne
f600cf35e8 fixes in app help file ; commented out fake TTS for Bul and Cat ; remove []_ from output with unlinearized functions, so that speech doesn't get garbled. 2014-12-05 09:23:44 +00:00
aarne
db97a2b0e4 quick reference text prepended to app help file 2014-12-04 20:30:50 +00:00
hallgren
2cca456da9 Wide Coverage Translation Demo web app: updated to use App12.pgf 2014-12-03 15:08:56 +00:00
aarne
8beead40bc Catalan in android app builder ; updated app document with Cat ; substitute voice output for Bulgarian and Catalan ; replaced brackets in unknown words by capitalization (for better speech output ; this is experimental) 2014-12-03 14:38:17 +00:00
aarne
7316caf092 app Makefile default now App12 with Cat 2014-12-03 13:18:48 +00:00
hallgren
15a47610be examples/app/Makefile: fix dependencies and grammar name for App12.pgf 2014-12-03 12:26:55 +00:00
aarne
72e45bbf95 Catalan added to App, do 'make App12.pgf' 2014-12-03 09:00:59 +00:00
kr.angelov
d304bf6348 faster translation in the app 2014-12-01 23:15:24 +00:00
kr.angelov
b552ef79d9 better color filter to indicate listening 2014-12-01 21:13:09 +00:00
kr.angelov
353055c2c0 added visual feedback to indicate that the app is not listening anymore 2014-12-01 20:52:37 +00:00
kr.angelov
30383f6ce2 fix in nordic.xml 2014-12-01 20:24:13 +00:00
kr.angelov
7a4d9af97f added special nordic keyboard for Finnish and Swedish 2014-12-01 12:43:31 +00:00
kr.angelov
64feca59c8 fix the last patch 2014-12-01 11:03:50 +00:00
kr.angelov
960ba43149 a small optimization in the PGF parser which gives me ~5% speed up 2014-12-01 10:48:15 +00:00
kr.angelov
14a2821fd8 fix in GNU lightning to enable the compilation of two of the the floating point operations. 2014-12-01 09:42:21 +00:00
kr.angelov
35e76a5fe8 fix in linearizer.h to make jpgf compilable 2014-12-01 09:41:48 +00:00
hallgren
b0f9ba0c8b WebSetup.hs: always use gf -j, to avoid problems compiling the Phrasebook 2014-11-27 17:48:53 +00:00
aarne
9ba5e6978b switch PhrasebookBul back to present to avoid cabal build failure. More to investigate here. 2014-11-27 17:08:35 +00:00
aarne
1e2627d9af make PhrasebookBul use alltenses to prevent misbehaviour in App 2014-11-27 16:36:51 +00:00
kr.angelov
6f2195f793 fix in linearizer.h which resolves a warning 2014-11-27 15:20:46 +00:00
kr.angelov
f63e8faf00 remove pgf/parser.h 2014-11-27 11:12:14 +00:00
kr.angelov
41e217a641 fix the handling of the heuristic factor. it was broken when I added the BIND token which means that the App grammar was running about 2-3 times slower. 2014-11-26 15:56:36 +00:00
aarne
4b075da678 a compilable stub of PhrasebookJpn. Sent to a native speaker expert for completions. 2014-11-15 09:43:15 +00:00
hallgren
c707575bd7 Documentation improvements and cleanup relating to the IOE monad
Renamed appIOE to tryIOE (it is analogous to 'try' in the standard libraries).
Removed unused IOE operations & documented the remaining ones.
Removed/simplified superfluous uses of IOE operations.
2014-11-10 16:20:01 +00:00
hallgren
33571ba44f Some work to improve the structure of the haddock documenation 2014-11-10 15:23:02 +00:00
kr.angelov
cabafd68a6 expand the JIT window for x64 2014-11-07 15:43:12 +00:00
aarne
27a3f8584b fixes in PhrasebookChi 2014-11-07 14:29:03 +00:00
hallgren
ad36dbc0ed gf.cabal: when compiling with ghc>=7.8 require cgi>=3001.2.2.0 2014-11-05 15:38:10 +00:00
kr.angelov
70c70fa791 a skeletal module for higher-order pattern unification in the C runtime 2014-10-31 19:57:56 +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
hallgren
0519493ca9 Use terminfo to highlight warnings and errors in blue and red
This replaces the hardwired ANSI escape codes that were accidentally included
in a previous patch.

This adds a dependency on terminfo, but this should be unproblematic, since
haskeline already depends on the same underlying C library.

The color highlighting is omitted on Windows.
2014-10-28 19:04:48 +00:00
hallgren
e41d9e34bb Show paths relative to the current directory in progress reports
It is much nicer to see something like

- compiling FoodsSwe.gf...   write file FoodsSwe.gfo
- compiling FoodsTha.gf...   write file FoodsTha.gfo
- compiling FoodsTsn.gf...   write file FoodsTsn.gfo
- compiling FoodsTur.gf...   write file FoodsTur.gfo
- compiling FoodsUrd.gf...   write file FoodsUrd.gfo
linking ... OK
Writing Foods.pgf...

instead of

- compiling /Users/hallgren/src/GF/gf/examples/foods/FoodsSwe.gf...   write file /Users/hallgren/src/GF/gf/examples/foods/FoodsSwe.gfo
- compiling /Users/hallgren/src/GF/gf/examples/foods/FoodsTha.gf...   write file /Users/hallgren/src/GF/gf/examples/foods/FoodsTha.gfo
- compiling /Users/hallgren/src/GF/gf/examples/foods/FoodsTsn.gf...   write file /Users/hallgren/src/GF/gf/examples/foods/FoodsTsn.gfo
- compiling /Users/hallgren/src/GF/gf/examples/foods/FoodsTur.gf...   write file /Users/hallgren/src/GF/gf/examples/foods/FoodsTur.gfo
- compiling /Users/hallgren/src/GF/gf/examples/foods/FoodsUrd.gf...   write file /Users/hallgren/src/GF/gf/examples/foods/FoodsUrd.gfo
linking ... OK
Writing Foods.pgf...
2014-10-28 15:02:29 +00:00
hallgren
f085b807eb A couple of haddock documentation improvements 2014-10-28 14:58:43 +00:00
kr.angelov
efedec187c an explicit SAVE instruction 2014-10-26 11:40:12 +00:00
kr.angelov
6986f1acd7 comment out a few assertions in bits.h. this code is run too often to have explicit assertions 2014-10-24 11:15:40 +00:00
kr.angelov
8abbd2f67e make it possible to specify the initial size of a map in libgu 2014-10-24 09:17:22 +00:00
kr.angelov
dc62e52636 simplify gu/map 2014-10-24 08:56:39 +00:00
kr.angelov
550c747941 fix memory leak in the pgf-parse tool 2014-10-24 08:42:32 +00:00
kr.angelov
5cae930723 add extern declarations for all inline functions in seq.h. this ensures that everything works even when the compiler's optimizations are off 2014-10-24 08:26:58 +00:00
kr.angelov
e169f225cf a simple optimization in cmp_item_prob with great effect on the parser's speed 2014-10-23 21:22:22 +00:00
kr.angelov
18f8f2e4f4 remove some deadcode in gu/seq.h 2014-10-23 21:21:21 +00:00
kr.angelov
aff68e7422 inline a number of functions in gu/seq.c. this has a noticeable effect on the parser's speed 2014-10-23 21:19:29 +00:00
kr.angelov
3aaeb7a156 a cosmetic optimization in mem.c 2014-10-23 15:45:14 +00:00
kr.angelov
fc6658c2e7 fix the debug mode in the reasoner 2014-10-23 08:15:12 +00:00
kr.angelov
578df576ef fix warning in ucs.c 2014-10-23 07:44:41 +00:00
hallgren
6ee67cd04f Various small changes for improved documentation 2014-10-22 15:45:52 +00:00
kr.angelov
00922153aa CAPIT is now naturally supported in the C runtime 2014-10-22 15:05:55 +00:00
kr.angelov
df113f9cc4 add Unicode classification routines to libgu. ported from the base package in Haskell. 2014-10-22 14:36:58 +00:00
kr.angelov
c8b3865338 an explicit PUSH_FRAME instruction 2014-10-22 14:11:41 +00:00
kr.angelov
71d5cae4e3 make the fields of BracketedString in the Python binding read/write 2014-10-22 12:18:07 +00:00
hallgren
391b301881 ModuleName and Ident are now distinct types
This makes the documentation clearer, and can potentially catch more
programming mistakes.
2014-10-21 19:20:31 +00:00
hallgren
3bfcfa157d Renaming SourceGrammar to Grammar and similarly for some related types
Included renamings:

	SourceGrammar -> Grammar
	SourceModule -> Module
	SourceModInfo -> ModuleInfo
	emptySourceGrammar -> emptyGrammar

Also introduces a type synonym (which might be good to turn into a newtype):

	type ModuleName = Ident

The reason is to make types like the following more self documenting:

	type Module = (ModuleName,ModuleInfo)
	type QIdent = (ModuleName,Ident)
2014-10-21 14:42:31 +00:00
aarne
f6441b2292 use of 'head' in TypeCheck/RConcrete created an uncomprehensible error message. Now checking for the emptiness of the list concerned, so that the error can be found. 2014-10-20 20:06:46 +00:00
hallgren
a9bc116052 Some small documentation improvements 2014-10-20 19:45:43 +00:00
hallgren
8337a19b40 type IOE a = IO a
IOE used to be a monad with extra error handling built on top of the IO monad,
But the IO monad already supports error handling, so this construction was a
superfluous.

The new 'instance ErrorMonad IOE' is defined to preserve the previous error
handling behaviour, i.e. the function 'handle' only catches errors thrown with
'raise' (or 'fail') and not other errors in the IO monad.
2014-10-20 19:32:46 +00:00
hallgren
55aebadd5a Remove some dead code
* The following modules are no longer used and have been removed completely:

	GF.Compile.Compute.ConcreteLazy
	GF.Compile.Compute.ConcreteStrict
	GF.Compile.Refresh

* The STM monad has been commented out. It was only used in
  GF.Compile.SubExpOpt, where could be replaced with a plain State monad,
  since no error handling was needed. One of the functions was hardwired to
  the Err monad, but did in fact not use error handling, so it was turned
  into a pure function.

* The function errVal has been renamed to fromErr (since it is analogous to
  fromMaybe).

* Replaced 'fail' with 'raise' and 'return ()' with 'done' in a few places.

* Some additional old code that was already commented out has been removed.
2014-10-20 15:05:43 +00:00
kr.angelov
bb1f0f3368 get rid of gu/str.(c|h) 2014-10-20 07:50:42 +00:00
aarne
84bce336fd (un)lexmixed: added the other math environments than $ used in latex 2014-10-19 17:43:39 +00:00
aarne
6c2e0d5ce2 ps -lines preserves line-by-line structure when preprocessing files for parsing line by line 2014-10-17 15:50:03 +00:00
aarne
5c862a3c7b one general case in dealing with backslash in latex lexing is enough 2014-10-17 15:49:23 +00:00
kr.angelov
3f11f3d602 the C runtime now supports reading and writing expressions with indexed meta variables. The type checker generates fresh indices 2014-10-17 09:27:37 +00:00
hallgren
955c4b6a23 Use http instead of https in the links to the build job in jenkins
The ci.zjyto.net web site uses an SSL certificate that is not recognized by
mainstream browsers (e.g. Firefox, Safari and the Android web browser).
2014-10-17 08:26:09 +00:00
aarne
2caf6fa125 unlexing latex code: no space between closing $ and punctuation 2014-10-17 07:04:50 +00:00
aarne
42cfacbf86 lexer for latex code: don't separate backslash from the macro name that it marks 2014-10-17 06:40:06 +00:00
hallgren
6375bacc73 Some work on the haddock documentation 2014-10-16 16:28:54 +00:00
gregoire.detrez
070057e695 Change the path to the build job in jenkins 2014-10-16 15:51:08 +00:00
hallgren
5a641ebe73 Rename src/programs/gf.hs to gf-main.hs to avoid confusing GHC
It appears that GHC can't keep GF.hs and gf.hs apart on systems with case
insensitive file names.
2014-10-16 15:21:00 +00:00
hallgren
2e2e7acf12 Turn the GF compiler into a library. Main program is now in src/programs/gf.hs
The module src/compiler/GF.hs now serves as a prelimiary compiler API. It just
exports a selection of functions and types from the compiler.

Haddock documentation can be generated with

	cabal haddock --hyperlink-source

Also bumbed the version number to 3.6.10.
2014-10-16 15:00:49 +00:00
hallgren
c924491289 More haddock documentation improvements 2014-10-16 14:03:57 +00:00
kr.angelov
c0ebbc4edf bugfix in the parser for abstract expressions in the C runtime 2014-10-16 11:40:47 +00:00
kr.angelov
26ad164cec finally proper stack unwind in the evaluator 2014-10-16 10:00:32 +00:00
hallgren
b70dba87ba Rename modules GFI, GFC & GFServer...
... to GF.Interactive, GF.Compiler & GF.Server, respectively.
2014-10-15 21:04:29 +00:00
hallgren
393dde2eb9 Fixes for the haddock documentation 2014-10-15 20:42:36 +00:00
gregoire.detrez
8381c7b0c0 Make cabal sdist fail with an informative error message` 2014-10-15 08:51:39 +00:00
gregoire.detrez
503a29e002 Add a make target to create the source distribution
`make sdist` will create a `dist/gf-<version>.tar.gz package
with the source files (using the `darcs dist` command).
2014-10-15 08:51:25 +00:00
hallgren
b0e9ded3cd Setup.hs: comment out sDistHook, which seems to be broken but is not used 2014-10-14 15:03:47 +00:00
kr.angelov
ac288386c4 the compiler now allows + to be used as a floating point addition in the abstract syntax 2014-10-14 11:15:18 +00:00
kr.angelov
b5cc77aea1 yet another bugfix in the byte code 2014-10-14 10:39:28 +00:00
kr.angelov
37bd8dd9fd another bugfix in the byte code generation 2014-10-14 09:43:43 +00:00
kr.angelov
f4dc2c0b6e bugfix in the bytecode generator 2014-10-14 09:27:24 +00:00
kr.angelov
1c2e02ad50 simplify jit_bare_ret 2014-10-14 09:09:26 +00:00
kr.angelov
2b881397c5 a refactoring in the Susanne converter which for some reason was not pushed before 2014-10-10 12:10:44 +00:00
kr.angelov
f8b73d593c Prelude.CAPIT is now a built-in primitive. It still generates &| in the Haskell runtime but will be intepreted in the C runtime 2014-10-09 19:34:12 +00:00
kr.angelov
86e9acc7a7 throw away the long obsolete runtime type information in the C runtime 2014-10-09 13:44:26 +00:00
kr.angelov
8e3ed825a8 fix two warnings in mem.c 2014-10-09 13:22:39 +00:00
kr.angelov
b905558ce8 fix in gu_mmap_pool for Android 2014-10-09 13:21:56 +00:00
kr.angelov
397276defd fix for lightning for ARM 2014-10-09 13:17:01 +00:00
kr.angelov
3e49a1cf73 remove the pgf-service util which is obsolete anyway 2014-10-09 11:28:56 +00:00
kr.angelov
6c86e7fa91 replace the hash maps in the abstract syntax with binary search tables 2014-10-09 08:38:55 +00:00
kr.angelov
84b257e85c add the const modifier to the key in the two procedures for binary search in libgu 2014-10-09 07:25:26 +00:00
kr.angelov
a9a781e4a0 use MAP_FIXED in gu_mmap_pool 2014-10-08 19:43:08 +00:00
kr.angelov
f178be5405 an experimental memory mapped pool. still not in use 2014-10-08 18:28:51 +00:00
hallgren
539f0880a3 GF.Infra.Options: change from String to Int in the type of optJobs 2014-10-08 16:57:04 +00:00
kr.angelov
9c2f71b07a now we statically allocate closures for all top-level functions and all nullary constructors. closures are dynamically allocated only for CAFs. this reduces memory use and time to allocate dynamic closures 2014-10-08 12:57:29 +00:00
kr.angelov
67781996b6 a missing case in instruction SET 2014-10-07 20:05:05 +00:00
kr.angelov
35333385b6 bugfix in the byte code compiler 2014-10-07 20:03:54 +00:00
kr.angelov
e98d61b7b7 added a missing case for PUSH instruction with a global closure 2014-10-07 11:46:38 +00:00
kr.angelov
de1b372ef7 the indirection should be done in the evaluate_expr_thunk gate instead of in the pgf_evaluate_expr_thunk function. this ensures lazyness 2014-10-07 07:12:40 +00:00
kr.angelov
13c7721bc5 using instruction RET was wrong; now use EVAL 2014-10-06 15:57:42 +00:00
kr.angelov
af7feea385 fix the order in which arguments are stored in the mk_const gate 2014-10-06 12:31:39 +00:00
kr.angelov
a50315396f push a stack frame around recursive calls to guarantee that a nested call to a failing function will not crash 2014-10-06 09:21:08 +00:00
kr.angelov
889c0f3df4 partial implementation for the FAIL instruction 2014-10-06 09:04:25 +00:00
kr.angelov
4e00834c68 bugfix in pgf_evaluate_expr_thunk 2014-09-30 17:34:29 +00:00
kr.angelov
f5da57056c fix pgf_value2expr for partial applications 2014-09-30 13:46:46 +00:00
kr.angelov
312d4ff52e enough fixes to get the JIT compiler compile for ARM. It is still broken if you try to use it 2014-09-30 12:39:31 +00:00
kr.angelov
b7798f9348 add evaluator.c in Android.mk 2014-09-30 12:37:18 +00:00
kr.angelov
f25b45e13d fix in reader.h for compiling jpgf.c 2014-09-30 11:25:27 +00:00
kr.angelov
6be25aa872 fix in pgf_print_expr for lambda abstractions with more than one argument 2014-09-30 09:42:18 +00:00
aarne
7c5cb356ca AppChi needs more stack space now 2014-09-30 09:35:51 +00:00
kr.angelov
70455b88a7 bugfix in the gate evaluate_value_lambda 2014-09-30 08:42:06 +00:00
kr.angelov
f70eecb63c minor stylistic change in GenerateBC 2014-09-29 15:08:00 +00:00
kr.angelov
80acad4447 bugfix in the pattern matching compiler and a number of other fixes that I somehow did not push before 2014-09-29 15:00:04 +00:00
kr.angelov
1ecd61f7f5 bugfix in the RET instruction 2014-09-29 13:04:49 +00:00
kr.angelov
87c5c4b0cc enlarge the code window in pgf_jit_gates to ensure enough space on 64-bit machines 2014-09-29 07:34:32 +00:00
aarne
aef787aeb1 checked that course of value tables (table P [...]) have the correct number of values w.r.t the type P. This was previously not checked, and caused hard-to-find run-time errors. 2014-09-27 17:14:35 +00:00
aarne
ca1cad68d0 command for AppEngFin 2014-09-26 14:48:09 +00:00
kr.angelov
7036d56d29 the literals API is now exposed in Python 2014-09-25 11:59:40 +00:00
kr.angelov
8e64fc6e7e switch off the debugging of the JIT compiler which I had turned on accidentally. silence two harmless warnings 2014-09-25 11:44:45 +00:00
kr.angelov
14e6eec5ec now a complete JIT compiler and ByteCode compiler for the def rules in the abstract syntax. there might be some bugs yet to be found, meta variables and computation under lambda is only partially supported 2014-09-25 10:35:06 +00:00
hallgren
928217f9d9 examples/app/Makefile2: add missing -probs flag 2014-09-23 12:20:44 +00:00
hallgren
13fe719a26 doc/gf-developers.t2t: add a note about how to create OS X Installer packages 2014-09-23 12:18:17 +00:00
hallgren
db9aeb2fa2 haskell-bind/PGF2.hsc: unexport functions that break referential transparency
loadConcr, unloadConcr and addLiteral modify the Concr structure as a side
effect. This means that other functions with a Concr argument (e.g. parse
and linearize) are no longer pure.

Possible solutions:

1. Don't try to hide the imperative nature of the C run-time system: remove
   all uses of unsafePerformIO and let all functions operate in the IO monad.

2. Don't export functions with side effects. Perhaps the desired functionality
   of loadConcr, unloadConcr and addLiteral can be folded into readPGF.
   The Concr structures can then treaded as immutable after after the
   readPGF function returns...
2014-09-22 14:05:17 +00:00
kr.angelov
3ced115807 forgot to type check the type of a typed let expression 2014-09-17 22:25:08 +00:00
kr.angelov
e34d5b0409 appForm now skips over Typed expressions 2014-09-17 22:02:36 +00:00
kr.angelov
a5f81ff81c the type checker for the abstract syntax now allows let expressions in def rules, since they are easily compilable to byte code. This fails in the Haskell runtime since let expressions are not allowed as abstract syntax expressions. 2014-09-17 21:59:45 +00:00
kr.angelov
818896dec2 fix a portability problem with the Python binding (found by Prasanth) 2014-09-17 16:12:40 +00:00
kr.angelov
3e3178abfa dummy jit_base_tail_finishr for x86_64. 2014-09-16 12:29:35 +00:00
aarne
8d18828008 enabled VP-valued rules for V2V, V3, etc in App. Improve quality with less loss of speed than VPSlash-valued original rules. 2014-09-15 16:10:18 +00:00
aarne
2d91097f49 enabled many more functions, in particular verb patterns, in App, to increase translation quality. This comes with 30% longer translation time with my benchmark but should still be OK. 2014-09-14 08:43:21 +00:00
aarne
d19b38657f GF index: shortcut links to Android app, Best practices, REMU, and new Android development instructions 2014-09-12 09:01:43 +00:00
kr.angelov
621d748bac a major revision of the bytecode generator and JIT compiler. the effect is that now we can compute with lambda functions and with true tail recursion 2014-09-11 15:39:39 +00:00
hallgren
18ee232497 gf.cabal: add missing c-sources for the Haskell binding to the C run-time library 2014-09-11 11:53:07 +00:00
hallgren
4f9af46ed0 Setup.hs: don't ask darcs for the version history if _darcs is not present
This is to avoid a (harmless) error message from darcs when compiling sources
obtained e.g. from github.
2014-09-11 11:47:17 +00:00
kr.angelov
df0602723d now release the FunPtr:s that are allocated for each literal callback 2014-09-10 15:41:53 +00:00
kr.angelov
80725e872b added an API for custom literals in the Haskell binding 2014-09-10 14:56:18 +00:00
kr.angelov
b553729f37 added loadConcr/unloadConcr to the Haskell binding. This exposes an API for loading grammars compiled with -split-pgf 2014-09-10 14:35:54 +00:00
hallgren
566aeb93f5 Wide Coverage Demo web app: use the App grammar instead of the Translate grammar
This gives faster but slightly lower quality translations.
2014-09-09 13:53:10 +00:00
hallgren
4eb6b55e98 (1) Refactor concurrency, (2) write to .gfo.tmp then rename to .gfo
(1) introduces the module GF.Infra.Concurreny with lifted concurrency
    operators (to reduce uses of liftIO) and some additional concurrency
    utilities, e.g. a function for sequential logging that is used in
    both GF.CompileInParallel and GFServer.
(2) avoids leaving broken .gfo files behind if compilation is aborted.
2014-09-08 15:43:20 +00:00
kr.angelov
4d28c7632e the code for def rules now uses proper graph update to preserve lazyness 2014-09-05 11:53:02 +00:00
kr.angelov
86b5f78c57 full support for recursive def rules in the C runtime 2014-09-05 10:09:43 +00:00
hallgren
a21ffc1941 gf.cabal, gf-server.cabal: add version bounds on network & httpd-shed
* httpd-shed-0.4 does not specify an upper bound on network, but it fails
  to build against network>=2.6. This is fixed in httpd-shed-0.4.0.2.
* With network-2.6, the Network.URI modules is moved to a separate package,
  so for the time being GF requires network>=2.3 && <2.6. This is compatible
  with the four most recent versions of the Haskell Platform.
2014-09-03 15:40:26 +00:00
hallgren
e0e6079c91 src/server: refactoring to isolate dependencies on the cgi/fastcgi packages
* Introducing the module CGI, re-exporting a subset of the cgi package. It
  might complete replace the cgi package in the future.
* Introducing the module CGIUtils, containing functions from FastCGIUtils that
  have nothing to do with fastcgi.

Some low level hackery with unsafePerformIO and global variables was left
in FastCGIUtils, but it is actually not used, neither for gf -server nor
exec/pgf-fcgi.hs.
2014-09-02 12:27:47 +00:00
kr.angelov
bfd414554d partial implementation for recursive def rules 2014-09-01 14:51:20 +00:00
kr.angelov
342f6e3797 bug fixes in the JIT compiler 2014-09-01 12:53:14 +00:00
aarne
4e8cd9119e by_Prep causing conflict in AppChi, therefore excluded from the import of PhrasebookChi 2014-08-30 23:13:39 +00:00
hallgren
d3d1d20a8a examples/app/Makefile2: simplifed Makefile for the App grammar (doesn't work yet)
This makefile just calls GF once and lets GF figure out in which order to
compile things. It uses the -j flag to enable parallel compilation and
specifies an explicit -path, overriding the -path flags in the source files.
This allows all needed modules to be found automatically and ensures that
that alltenses is consistently used everywhere. But for some reason, this
doesn't work...
2014-08-30 17:00:14 +00:00
hallgren
d0d470620c Add OS X Installed package to the GF 3.6 download page 2014-08-29 11:48:53 +00:00
hallgren
bcf0aa42cd bin/build-binary-dist.sh: just a small fix 2014-08-29 11:48:10 +00:00
kr.angelov
cee5f590ca added evaluator.h which I had forgoten 2014-08-29 08:36:53 +00:00
hallgren
658b9adabe You can now use 'make pkg' to build OS X Installer packages for GF
The script bin/build-binary-dist.sh has been updated to build either a plain
.tar.gz package or OS X Installer package (.pkg).

Note that bin/build-binary-dist.sh is designed to build and include the
C run-time system in the binary package.  If the C run-time system fails to
build, no binary package will be created.
2014-08-28 13:30:22 +00:00
hallgren
883d1ae21c gf.cabal ghc-options: don't force -j, -auto-all has been renamed to -fprof-auto 2014-08-25 23:30:22 +00:00
hallgren
fdf7d06f9a Fix GHC 7.4 compatibility issue caused by previous patch 2014-08-25 11:26:58 +00:00
hallgren
a494c713e1 Setup.hs: disable parallel RGL build support for now, since it is incompatible with Cabal<1.20 2014-08-25 11:22:20 +00:00
hallgren
d84c5ef171 Experimental: parallel batch compilation of grammars
On my laptop these changes speed up the full build of the RGL and example
grammars with 'cabal build' from ~95s to ~43s and the zero build from ~18s
to ~5s.

The main change is the introduction of the module GF.CompileInParallel that
replaces GF.Compile and the function GF.Compile.ReadFiles.getAllFiles. At
present, it is activated with the new -j flag, and it is only used when
combined with --make or --batch. In addition, to get parallel computations,
you need to add GHC run-time flags, e.g., +RTS -N -A20M -RTS, to the command
line.

The Setup.hs script has been modified to pass the appropriate flags to GF
for parallel compilation when compiling the RGL and example grammars, but you
need a recent version of Cabal for this to work (probably >=1.20).

Some additonal refactoring were made during this work. A new monad is used to
avoid warnings/error messages from different modules to be intertwined when
compiling in parallel, so some functios that were hardiwred to the IO or IOE
monads have been lifted to work in arbitrary monads that are instances in
the appropriate classes.
2014-08-25 09:56:00 +00:00
aarne
9253d54b7e made the "how old" construction in Chinese more efficient by moving variants to the top level; the resulting rule is the same. This kind of inefficiencies are best found if you compile with the -v option and check for constructors creating unexpectedly many PGF rules. 2014-08-24 14:28:48 +00:00
kr.angelov
a39647d771 bugfix in the android app 2014-08-22 12:33:35 +00:00
hallgren
6bde56bef7 src/www/robots.txt: robot exclusion file for the GF cloud service.
To reduce potential server load caused by search bots.
2014-08-22 12:13:04 +00:00
hallgren
8dfaf2ef65 Command line flag -s/-q now silences all warnings
These flags now do what the say.
2014-08-22 00:30:33 +00:00
hallgren
21f429caf8 Add lifted directory operations in GF.System.Directory to eliminate the need for liftIO in various places 2014-08-20 17:47:08 +00:00
hallgren
73310add9a GF.CompileOne: refactoring to reduce code duplication and improve readability
I prefer small functions with descriptive names over large monilithic chunks
of code, so I grouped the compiler passes called from compileSourceModule
into funcitons named frontend, middle and backend. This also makes decisions
about which passes to run clearly visible up front.

Also made some small changes in GF.Compile.
2014-08-20 17:04:15 +00:00
hallgren
61760e4205 GF.Compile.ReadFiles: a simpler & faster way to convert from Latin1 to UTF-8 2014-08-19 14:27:15 +00:00
hallgren
60b5990792 Fix compliation error with GHC 7.4 caused by previous patch 2014-08-13 22:21:54 +00:00
hallgren
cd5193b7e1 Fix warnings in 16 modules, mostly forward compatibility warnings from GHC 7.8 2014-08-13 22:16:18 +00:00
hallgren
a06351b625 Refactoring in GF.Compile and GF.ReadFiles with an eye to parallel compilation
In particular, the function compileOne has been moved to the new module
GF.CompileOne and its type has been changed from

    compileOne :: ... -> CompileEnv -> FilePath -> IOE CompileEnv

to

    compileOne :: ... -> SourceGrammar -> FilePath -> IOE OneCompiledModule

making it more suitable for use in a parallel compiler.
2014-08-13 16:46:11 +00:00
hallgren
64a3f76b1f Setup.hs: reduce zero build time by a couple of seconds
The RGL is now compile with only three calls to GF (prelude, present,
alltenses). This also makes even more parallelism available to GF for speeding
up full builds of the RGL.
2014-08-13 16:25:03 +00:00
hallgren
9093ff3fe5 GF.Compile: remove the Int from CompileEnv
It has been unused since the refresh pass was removed.
This eliminates one obstacle to parallel module compilation.
2014-08-11 16:30:11 +00:00
kr.angelov
c30e2df228 pattern matching in def rules is now supported 2014-08-11 15:53:41 +00:00
kr.angelov
d3b9652b81 revert an accidental change that I pushed together with the last patch 2014-08-11 11:44:49 +00:00
kr.angelov
584d589041 a partial support for def rules in the C runtime
The def rules are now compiled to byte code by the compiler and then to
native code by the JIT compiler in the runtime. Not all constructions
are implemented yet. The partial implementation is now in the repository
but it is not activated by default since this requires changes in the
PGF format. I will enable it only after it is complete.
2014-08-11 10:59:10 +00:00
hallgren
02dda1e66f Setup.hs: don't build example grammars when the rgl-none argument is specified 2014-08-08 17:02:36 +00:00
hallgren
f07096c409 Setup.hs: comment out debugging code 2014-07-28 15:35:22 +00:00
hallgren
4adb4bab71 Setup.hs: reduce zero build time by ~30% (from 26 to 18 seconds on my laptop)
This speedup is obtained by instead of generating 211 shell commands to compile the RGL one file at a time, generate 7 shell commands, passing a number of
related files to GF in one go.

In addition to cutting down the zero build time, this opens up for speeding up
full builds of the RGL, by adding more parallelism in GF's grammar compilation
machinery.

(Note: gf.cabal already takes advantage of GHC's parallel build option to
speed up the compilation of GF itself, if GHC>=7.8 is used.)
2014-07-28 15:11:58 +00:00
hallgren
7a91afc02a Convert from Text.PrettyPrint to GF.Text.Pretty
All compiler modules now use GF.Text.Pretty instead of Text.PrettyPrint
2014-07-28 11:58:00 +00:00
hallgren
59172ce9c5 Adding GF.Infra.Location and GF.Text.Pretty (forgot to 'darcs add' them before) 2014-07-27 22:13:13 +00:00
hallgren
30cda51516 Introducing GF.Text.Pretty for more concise pretty printers and GF.Infra.Location for modularity
GF.Text.Pretty provides the class Pretty and overloaded versions of the pretty
printing combinators in Text.PrettyPrint, allowing pretty printable values to
be used directly instead of first having to convert them to Doc with functions
like text, int, char and ppIdent. Some modules have been converted to use
GF.Text.Pretty, but not all. Precedences could be added to simplify the pretty
printers for terms and patterns.

GF.Infra.Location contains the types Location and L, factored out from
GF.Grammar.Grammar, and the class HasSourcePath. This allowed the import
of GF.Grammar.Grammar to be removed from GF.Infra.CheckM, making it more
like a pure library module.
2014-07-27 22:06:23 +00:00
Sergei Trofimovich
7eaea44386 gf.cabal: fix depend in --flags=-custom-binary case
Detected when building today:

Building gf-3.6...
Preprocessing library gf-3.6...

src/runtime/haskell/PGF/Internal.hs:17:8:
    Could not find module ‘Data.Binary.IEEE754’
    It is a member of the hidden package ‘data-binary-ieee754-0.4.4’.
    Perhaps you need to add ‘data-binary-ieee754’ to the build-depends in your .cabal file.
2014-07-25 14:41:11 +00:00
hallgren
3660339b23 PGF service: expire PGFs from the cache when they have been unused for 24 hours
...to keep memory use down on the server.
2014-07-21 15:53:38 +00:00
hallgren
1ba0c4b354 WebSetup.hs: include Chinese when building the Phrasebook 2014-07-21 15:48:49 +00:00
aarne
1780742549 Qiao's corrections in PhrasebookChi. This replaces the old, partial and low-quality version and is hence the first Chinese phrasebook version that can claim high quality. 2014-07-16 21:07:34 +00:00
hallgren
3ec95e481b src/server/gf-server.cabal: update dependencies 2014-07-15 12:00:51 +00:00
aarne
810acc9258 modified some explanations in app.html 2014-07-15 09:55:45 +00:00
john.j.camilleri
37a35734a5 PGF Web Service: include entire completion in full mode
When using full=yes in the web service 'complete' command,
you now get an additional field 'seq' with the longest possible completion.
So, given:

  lin
    f1 = ss "the" ;
    f2 = ss ("the red house" | "the real deal") ;

and trying to complete on input "th", you get:

    [
        {
            "from": "TestCnc",
            "brackets": {
                "cat": "_",
                "fid": 0,
                "index": 0,
                "fun": "_",
                "children": []
            },
            "text": "th",
            "completions": [
                {
                    "token": "the",
                    "funs": [
                        {
                            "fun": "f1",
                            "hyps": [],
                            "cat": "C",
                            "seq": "the"
                        },
                        {
                            "fun": "f2",
                            "hyps": [],
                            "cat": "C",
                            "seq": "the red house"
                        },
                        {
                            "fun": "f2",
                            "hyps": [],
                            "cat": "C",
                            "seq": "the real deal"
                        }
                    ]
                }
            ]
        }
    ]
2014-07-15 09:33:22 +00:00
john
9b49608451 PGF web service: Return additional completion info with 'full' flag
BETA! The 'complete' command now has a new flag 'full' which when set
returns additional info about completions.

Without 'full' flag (default):

[
    {
        "from": "PhrasebookEng",
        "brackets": {
            "cat": "_",
            "fid": 0,
            "index": 0,
            "fun": "_",
            "children": [
                {
                    "token": "the"
                }
            ]
        },
        "text": "su",
        "completions": [
            "supermarket",
            "suspect"
        ]
    }
]

With full=true or full=yes:

[
    {
        "from": "PhrasebookEng",
        "brackets": {
            "cat": "_",
            "fid": 0,
            "index": 0,
            "fun": "_",
            "children": [
                {
                    "token": "the"
                }
            ]
        },
        "text": "su",
        "completions": [
            {
                "token": "supermarket",
                "funs": [
                    {
                        "fid": 421,
                        "fun": "Supermarket",
                        "hyps": [],
                        "cat": "PlaceKind"
                    }
                ]
            },
            {
                "token": "suspect",
                "funs": [
                    {
                        "fid": 445,
                        "fun": "Suspect",
                        "hyps": [],
                        "cat": "Property"
                    }
                ]
            }
        ]
    }
]
2014-07-11 09:25:26 +00:00
kr.angelov
0222d2440c implemented computing with abstract syntax trees. It passes all test cases except those that require def rules. The design is consistent with the STG virtual machine 2014-07-08 19:45:49 +00:00
kr.angelov
e0fe6d01c4 bugfix for the typechecker in the C runtime 2014-07-08 19:19:48 +00:00
kr.angelov
ada85ae44e an API for visitor patterns on abstract syntax trees from Python. This makes the embedded grammars especially pleasing 2014-07-06 23:48:51 +00:00
kr.angelov
85672af858 small fix for the embedded mode in Python 2014-07-06 19:55:08 +00:00
kr.angelov
e52d5bf715 embedded mode for GF grammar in Python. Only generation for now 2014-07-06 19:49:17 +00:00
aarne
ac1e58817b making hard-wired questiong in PhrasebookChi type correct after addition of indirect questions 2014-07-05 08:34:22 +00:00
kr.angelov
7ad2f7dac3 filter out the leading +/* from the parser tree 2014-07-03 18:27:39 +00:00
kr.angelov
aa746ad0f6 bugfix in the ParseTreeView 2014-07-03 18:09:34 +00:00
kr.angelov
272a8487f8 scroll bars for the ParseTreeView 2014-07-03 13:42:26 +00:00
kr.angelov
e0fa954256 Visualization for parse trees on Android 2014-07-02 11:30:06 +00:00
kr.angelov
abb50f9c73 added bracketedLinearize in the Java binding 2014-07-02 07:08:01 +00:00
kr.angelov
4a7055e994 fixed rare memory leak in the Java bindings 2014-07-02 07:06:51 +00:00
kr.angelov
064cf03005 a few changes in the Nerc that I have forgoten to push 2014-07-01 17:32:25 +00:00
kr.angelov
7aa8bf4150 fix warnings in the compilation of the Java binding 2014-07-01 17:31:29 +00:00
aarne
fd5525149b link to play store from app.html 2014-06-30 09:14:17 +00:00
hallgren
0715cfe2ae minibar: include the grammar's last modification in the grammar info shown by the "i" button
Also bumped version number in gf.cabal to 3.6-darcs.
Also removed some unecessary use of CPP.
2014-06-24 13:59:09 +00:00
hallgren
23ec403402 Adjust the release date on the home page 2014-06-23 13:33:38 +00:00
hallgren
e3e2227dfe Final updates of the download page for the 3.6 release
+ Describe which features are included in the different binary packages.
+ Describe the new MINGW package.
2014-06-23 13:30:33 +00:00
hallgren
89eb3fd60a Update web pages and bump version number to 3.6! 2014-06-21 18:29:29 +00:00
hallgren
cfbd152a39 doc/gf-developers.t2t: made the C run-time section a bit more informative 2014-06-23 13:28:10 +00:00
hallgren
3cba76592e release-3.6.t2t: just a couple of more fixes.
Sorry.
2014-06-21 18:25:52 +00:00
hallgren
f66440a1e7 release-3.6.t2t: fix broken link 2014-06-21 18:17:00 +00:00
hallgren
cba51a97ab release-3.6.t2t: fix a formatting problem 2014-06-21 18:12:47 +00:00
hallgren
03274b76d3 debian/changelog: updated for the release of GF 3.6 2014-06-21 17:10:24 +00:00
hallgren
5a39637bcd build-binary-dist.sh: include a ghc package configuration file
as an experiment
2014-06-21 16:32:10 +00:00
hallgren
38f28da6c1 Polished and renamed release notes to release-3.6.t2t
Also added an example use of lookupmorpho to gf-web-api-examples.html.
2014-06-21 13:02:10 +00:00
hallgren
58156369fa The --output-dir option now applies also to PGF files 2014-06-21 12:26:56 +00:00
hallgren
fc4c8b0058 Cloud service & apps: better error handling in wide coverage translation
The wide coverage demo apps now shows a "please wait" message while the grammar
is loading, and a red error message if the grammar is not found on the server.
The Simple Translation Tool also show red error messages if the grammar is not
found.
2014-06-20 18:39:28 +00:00
hallgren
9eb6557376 PGF Service: return error code 404 (not found) instead of 500 (internal server error) for missing grammars 2014-06-20 17:28:02 +00:00
hallgren
ef20e8cbac PGF Service, command=grammar: include the last modified time of the grammar in the output 2014-06-20 10:34:51 +00:00
aarne
2601dac641 added a note that the green translation comes from the phrasebook 2014-06-20 07:12:31 +00:00
aarne
a64dfe0bc8 some probabilities in app.probs to recognize languages and pronouns 2014-06-20 06:31:09 +00:00
aarne
85d80a89be restored some functions in PhrasebookDut to make it complete again 2014-06-19 18:08:03 +00:00
aarne
0e940b7fd1 style0 in app.html to preserve colours in table cells 2014-06-19 17:44:06 +00:00
hallgren
fb922b65c1 css/style0.css: like css/style.css but without changing the default table style 2014-06-19 17:42:37 +00:00
aarne
916ef5bc47 language status in app help file as table ; less text 2014-06-19 17:42:03 +00:00
aarne
23cc4981ab language status information in demo app and translation documents 2014-06-19 17:41:34 +00:00
hallgren
e7f9ad2a98 Demo page: fix the link to the android app 2014-06-19 17:05:21 +00:00
hallgren
e10ab227ef Demo page: add links to the wide coverage translation page and the android app 2014-06-19 17:00:23 +00:00
hallgren
660de6e1da WebSetup.hs: PhrasebookLav works again 2014-06-19 16:58:33 +00:00
inari
4af2576e7b revert AWant in WordsDut back to using niet as negation 2014-06-19 16:55:13 +00:00
inari
f36db77430 reverted AWant back to using niet negation 2014-06-19 16:51:55 +00:00
aarne
09476a16e2 renaming in PhrasebookDut to avoid name clash in App 2014-06-19 16:09:15 +00:00
aarne
5c7586bb78 a couple of fixes in Phrasebook ; should compile now 2014-06-19 15:55:39 +00:00
hallgren
f743217a54 debian/rules: a hack to put the python binding in the right directory
The setup.py script puts it under site-packages, but python only looks under
dist-packages...
Also some minor changes for 'make deb' in Makefile
2014-06-19 15:45:55 +00:00
inari
3b7f6a271f Add some more constructions with geen as negative in WordsDut 2014-06-19 15:05:34 +00:00
hallgren
5b325659f8 debian/rules: fix bug that prevented the Python binding from being included 2014-06-19 13:39:03 +00:00
hallgren
b49b6236d0 Update the GF shell reference manual 2014-06-19 10:58:35 +00:00
kr.angelov
9e94fca20b estimate the new values in app.probs as best as I can given the many grammar changes that were not reflected 2014-06-19 10:55:53 +00:00
inari
12fb4ab1a2 fixed negation in PhrasebookDut 2014-06-19 10:02:23 +00:00
hallgren
ceb4beeb84 runtime/c/setup.sh: use make -j to speed up compilation
The configuration script takes significantly longer to run than the compilation
of all the C code, which is a hint that is in need of a major simplification.
2014-06-19 09:26:44 +00:00
aarne
318c69f58a release notes: record update and RGL updates 2014-06-19 07:18:24 +00:00
aarne
67012288c0 section on record update in gf-refman 2014-06-19 07:10:43 +00:00
hallgren
2feb552925 Include the Python binding to the C run-time system in Debian packages 2014-06-19 00:43:53 +00:00
hallgren
f3c8adcc59 WebSetup.hs: skip PhrasebookLav for now 2014-06-19 00:20:31 +00:00
hallgren
a21a782e47 Compile example grammars during the build phase instead of the install phase
This allows more errors to be detected by the build bot.
TODO: fix the gf --output-dir flag, which does not seem to change where PGF
file are put.
2014-06-18 23:57:45 +00:00
aarne
3d5d600236 enabled more from Construction in App 2014-06-18 16:20:53 +00:00
hallgren
65b064fe82 build-binary-dist.sh: updated to include the Python binding to the C run-time
There are also some changes in src/runtime/python/setyp.py to support this.
2014-06-18 16:09:46 +00:00
aarne
d92f65f186 correction in app/README 2014-06-18 15:59:56 +00:00
aarne
28e50b0f5f quick hack: changed cat name Language to LAnguage in Phrasebook to avoid clash with Construction.Language in App 2014-06-18 15:38:11 +00:00
kr.angelov
fa33096e6d a small change in the keyboard layout for Android to make it more user friendly 2014-06-18 09:51:44 +00:00
kr.angelov
b41a8a1c16 filter out identical duplicated translations from the Android UI 2014-06-18 09:17:33 +00:00
hallgren
c1eb47a67a gf.cabal: add a maintainer field 2014-06-17 20:55:13 +00:00
hallgren
12994a3ec4 Some updates to the GF 3.6 download page and release notes 2014-06-17 20:25:58 +00:00
normundsg
dff7dd3a5d Redirecting grammaticalframework.org/framenet to remu.grammaticalframework.org/framenet 2014-06-17 15:24:45 +00:00
hallgren
050d435278 Compute/ConcreteNew.hs: eliminate selections from wildcard tables
This patch also includes some commented out code that was used to search for
the source of code size explosions and an eta expansion bug.
2014-06-17 14:47:55 +00:00
hallgren
6f8e52c944 doc/gf-developers.t2t: quick note on how to compile the C run-time system
Also a few other minor updates.
2014-06-17 14:17:59 +00:00
hallgren
1668eb17e5 build-binary-dist.sh: updated to include the C runtime system in binary tarballs
Also moved it to the bin directory.
Run it with 'bash bin/build-binary-dish.sh'.
2014-06-17 13:56:59 +00:00
hallgren
f435966bf3 Setup.hs: System.Cmd is deprecated, import System.Process instead 2014-06-17 13:27:14 +00:00
hallgren
dd2be5c75a gf-cloud-api.html: fix a broken link
Thanks to Dana Dannells.
2014-06-17 08:45:13 +00:00
kr.angelov
fe49ddf16d now the named entities recognizer returns dictionary entries if the name is known 2014-06-17 06:57:12 +00:00
hallgren
9944916127 src/runtime/c/setup.sh: executable version of INSTALL, used from debian/rules 2014-06-16 23:28:12 +00:00
hallgren
6c40e0ac37 debian/rules: include the C run-time system when building .deb packages 2014-06-16 20:12:44 +00:00
kr.angelov
b3f8b90f2b fixed memory leak in the Haskell binding to the C runtime 2014-06-16 08:49:13 +00:00
aarne
11d8df739e updated demos/translation.t2t with link to app and explanation of colours 2014-06-15 14:12:55 +00:00
hallgren
d6252d1c16 PGF library: expose only PGF and PGF.Internal instead of all modules
PGF exports the public, stable API.
PGF.Internal exports additional things needed in the GF compiler & shell,
including the nonstardard version of Data.Binary.
2014-06-12 14:43:18 +00:00
hallgren
352ecb7eb8 New GF home page: trying blue page title and tagline instead of red 2014-06-12 12:29:35 +00:00
kr.angelov
3d43c2687f swith off the debugging in the android ui 2014-06-12 09:37:40 +00:00
kr.angelov
86201df35c now GF keywords can be used as identifiers if they are quoted 2014-06-12 09:36:32 +00:00
hallgren
63c9dcd207 new.html: a proposed new look for the GF home page 2014-06-11 13:32:31 +00:00
hallgren
84b7a56fb2 Updating the release notes and installation instructions for the next release 2014-06-10 22:12:48 +00:00
hallgren
26aecdb4d3 PGF2.hsc: use throwIO instead of throw
From the documentation: the throwIO variant should be used in preference to
throw to raise an exception within the IO monad because it guarantees ordering
with respect to other IO operations, whereas throw does not.

Also removed some unused imports.
2014-06-10 12:42:01 +00:00
aarne
7b582218c9 CompoundN in app.probs 2014-05-29 11:04:24 +00:00
normundsg
0c5ad7ea11 FrameNet-GF API Doc 2014-05-29 11:45:09 +00:00
kr.angelov
67f64cb233 now we compile context-free grammars directly to PGF without going via GF source code. This makes it quick and lightweight to compile big grammars such as the Berkley grammar 2014-05-24 07:47:06 +00:00
kr.angelov
dbb4fdd0f7 bugfix in the Java binding. it was causing a crash in the Android app 2014-05-23 10:52:00 +00:00
kr.angelov
333e537e72 small fix in tabularLinearize 2014-05-22 13:33:18 +00:00
kr.angelov
757db06ba0 added tabularLinearize in the python binding 2014-05-22 13:30:14 +00:00
kr.angelov
df80a2042b bugfix: the keyboard should not show completions when entering web passwords 2014-05-22 07:25:33 +00:00
kr.angelov
32fe1d8453 the dictionary view in the app now filters out duplicated morphological analyses 2014-05-22 07:10:28 +00:00
aarne
aeb00013ce fixed the path in AppFin.gf so that it compiles in a more general setting 2014-05-22 06:23:57 +00:00
kr.angelov
e6fa0662e4 forgot to fix the path for AppFre.gf 2014-05-21 09:36:12 +00:00
aarne
f2e28c59c6 App compilation instructions: with parallel compilation, make Phrasebook separately 2014-05-21 08:19:34 +00:00
kr.angelov
75475b579d in verbosity mode the compiler warns about missing paths 2014-05-21 07:33:35 +00:00
aarne
43eaedd326 probabilities for App 2014-05-21 07:31:18 +00:00
kr.angelov
f3f0e7abd5 fix the path in the App grammar to the Phrasebook 2014-05-21 07:30:01 +00:00
hallgren
1bba23991f Compute/ConcreteNew.hs: adding a Prawitz rewrite
(table { p_i => t_i } ! x).l ==> table { p_i => t_i.l } ! x

This was used in the old partial evaluator and can significantly reduce term
sizes in some cases.
2014-05-16 21:27:20 +00:00
hallgren
307795f385 Fix an eta expansion bug in the grammar compiler
Eta expansion is applied between partial evaluation and PMCFG generation.
The buggy version generated type incorrect terms, but PMCFG generation
apparently worked anyway.
2014-05-16 14:10:07 +00:00
hallgren
e9b5b8b094 Simple Translator: fall back to word-for-word translation if the parser fails
Same as in the Wide Coverage demo app.
2014-05-15 13:58:42 +00:00
hallgren
121afca05a Haskell binding: free memory pool to avoid space leak when readPGF fails 2014-05-13 14:07:36 +00:00
hallgren
7c9ff164bf gf -server: include list of loaded PGFs in version info 2014-05-12 13:45:36 +00:00
hallgren
12a8e113c2 examples/phrasebook/Makefile2: add Chinese
Also remove arguments to raise the stack size, GF's built-in default is big
enough now.
2014-05-09 13:07:02 +00:00
john.j.camilleri
2fcc035623 Add link to IRC logs
The logs are simply dumped there in raw form, but at least having a link
should make them Google-indexed. One day we'll put something there with
an interface.
2014-05-09 06:53:41 +00:00
kr.angelov
41c8749b5c fix the literals API in Java for strings with non-latin characters 2014-05-08 14:56:46 +00:00
hallgren
1fbe17aabe Wide Coverage Demo Web App: bug fix: swapping source and target works again 2014-05-08 14:18:03 +00:00
hallgren
6f6e9096e8 Wide Coverage Demo Web App: bug fix: restore lost quality indications after switching target languages 2014-05-08 14:05:07 +00:00
hallgren
8d9816ee98 PGF web api, command c-wordforword: re-enable parsing of individual words
The space leak in the Haskell binding to the C parser has been fixed.
2014-05-08 11:38:41 +00:00
kr.angelov
58d0cdc943 fix memory leak in the Haskell binding 2014-05-08 08:41:58 +00:00
hallgren
fc6d8f6362 Wide Coverage Demo App: show all Phrasebook translations
Also improve behaviour for languages that are missing in Phrasebook (Chinese).
Also update the initial set of languages in the menus to match Translate11.pgf.
2014-05-07 23:42:05 +00:00
hallgren
70b192594e pgf-shell.hs: fix compilation problem with GHC 7.4 2014-05-07 17:06:34 +00:00
hallgren
04e7bdb6fe Two improvements in the pgf-shell example
1. Like pgf-translate, it now shows one result at a time, press Enter to get
   more results.
2. You can load a new grammar with the command 'i <path-to-pgf>'
2014-05-07 16:37:28 +00:00
aarne
27fc5e5b04 improved paths and Makefile in examples/app ; see README how to compile with just 'make -j' 2014-05-06 21:42:49 +00:00
aarne
41d7f2dfaf eliminated dependency of PhrasebookChi from DictionaryChi ; added 'make forApp' to compile what is needed for Phrasebook in App 2014-05-06 20:09:21 +00:00
aarne
d752167f59 some more words and phrases in PhrasebookChi ; native speaker check should be done soon 2014-05-03 15:57:21 +00:00
hallgren
bd80c3c201 Wide Coverage Web Demo: fix bug introduced in previous patch
Word-for-word translations were shown in the wrong language after switching
traget language.
2014-04-29 19:09:24 +00:00
hallgren
580b8cc783 Wide Coverage Demo App: translate to all available target langauges at once
This means that the new translation is available instantly when switching
target languages. It can also reduce space leaks problems in the server
somewhat by avoiding repeated parsing of the source text.
2014-04-29 16:01:57 +00:00
hallgren
a7b1f9e1b3 PGF web api, command c-wordforword: don't repeat parsing/morpho analysis for each target language
Also omit attemts to parse individual words for now, to avoid space leaks in
the Haskell binding to the C parser.
2014-04-29 15:51:46 +00:00
hallgren
2721f7358f Spring cleaning
Nothing major...
2014-04-28 13:56:20 +00:00
hallgren
b5fd7d88c1 Simple Translator: remove extra space before punctuation 2014-04-28 12:07:41 +00:00
kr.angelov
d278965095 an initial Java/C API for predicting literals. Still not utilized 2014-04-25 08:53:18 +00:00
kr.angelov
3a0da12e3d remove dead code to avoid warnings 2014-04-24 19:21:00 +00:00
kr.angelov
aefaed2056 make the input box in the conversation view self-adjustable when entering longer text 2014-04-24 19:18:28 +00:00
kr.angelov
2c9906336d a better solution for restoring the state of the main activity when the device is flipped. This one doesn't require hacks. 2014-04-24 18:50:20 +00:00
hallgren
e891e99725 Simple Translator: remove punctuation before wide coverage translation
This gives better translations with Translate11.pgf and is how the Wide
Coverage Demo App works.
2014-04-24 11:28:15 +00:00
kr.angelov
6808c3c982 a small fix to avoid showing * in some translations 2014-04-24 08:03:29 +00:00
kr.angelov
81c2184923 show the alternative translations in color 2014-04-24 08:00:52 +00:00
kr.angelov
5f7ca26002 show the probabilities for the alternative translations 2014-04-24 07:44:47 +00:00
kr.angelov
b2f5d97315 bugfix in the word completion in the input method 2014-04-24 07:27:34 +00:00
aarne
f5e4430e34 merged the edits 2014-04-24 07:23:40 +00:00
aarne
1e67d2531b updated app.html with new links 2014-04-24 07:15:48 +00:00
aarne
58615e6bc6 updated app help 2014-04-24 07:14:40 +00:00
kr.angelov
80e9b1e6b9 fix typo in the help file 2014-04-24 07:08:06 +00:00
kr.angelov
43706445be finally: the conversation view is now no longer cleared up everytime when the device is flipped 2014-04-23 20:27:46 +00:00
aarne
e60ec8d1da updated app.html with images and a link where a real app can now be found 2014-04-22 17:18:50 +00:00
aarne
e6363c51dd some edits in app help ; special lexer for Fre,Ita commented out as it is no longer needed 2014-04-22 16:00:54 +00:00
hallgren
e3ff79d49c Some work on the download page and release notes for the next release of GF
Please add things you think are imporant to mention to the release notes!
2014-04-22 14:45:37 +00:00
hallgren
570a417615 gf.cabal: require base>=4.3
This makes it explicit that we no longer support compiling GF with GHC 6.12
(which is 4 years old and comes with base-4.2).
2014-04-22 14:38:33 +00:00
kr.angelov
b70cea2673 bugfix in the handling of BIND in the C runtime 2014-04-22 13:53:18 +00:00
hallgren
a2c25e88d4 gf.cabal: add GF builtin default -K64M. Enable parallel compile with ghc>=7.8
+ Programs compiled with ghc<7.8 have a default built-in 8M stack size limit.
  With ghc>7.0 this built-in default can be changed, so it is now 64M, allowing
  GF to work with larger grammars without manually increasing the stack size.
  (But if GF is compiled with ghc 6.12, the built-in default is still 8M.)

+ Enable ghc>=7.8 support for compiling modules in parallel, to speed up the
  compilation of GF.
2014-04-22 12:43:24 +00:00
kr.angelov
5847f8e18f fix in the renaming 2014-04-22 11:55:22 +00:00
kr.angelov
c032781095 rename DGTranslator to Human Language Compiler. Added a new logo 2014-04-22 11:53:16 +00:00
aarne
d3020a2f19 a copy of app help file as demos/app.html 2014-04-21 08:45:32 +00:00
aarne
7340400758 some edits in app help 2014-04-21 08:40:38 +00:00
hallgren
0e21bcde22 Wide Coverage Demo web app: more client side caching
For example, you can now reorder paragraphs by cut & paste, without causing
anything to be sent to the server for re-translation.

Also some color & layout tweaks.
2014-04-17 13:48:00 +00:00
kr.angelov
b0b27a1b32 now word completion from Java works. It could be made better 2014-04-17 11:00:27 +00:00
hallgren
5cb5cdd31e Wide Coverage Demo App: show a word-for-word translation if all else fails 2014-04-16 15:37:09 +00:00
hallgren
dd96c8a2c6 PGF web API: adding the command c-wordforword
It has the same parameters and result format as c-translate, but it does
the translation word for word. (To be used as a last resort).
2014-04-16 15:24:23 +00:00
aarne
1bc77326e2 edits in App help ; name suggestion "Language Compiler" ; sepApo(), a quick fix to French and Italian elision in the App 2014-04-15 22:02:06 +00:00
aarne
fbcb5e1957 removed clash in AppFin imports 2014-04-15 21:26:33 +00:00
hallgren
7fc3627c6e PGF web API: add commands lookupmorpho and c-lookupmorpho 2014-04-15 14:50:38 +00:00
hallgren
2ea326a83e gftranslate.js: switch to Translate11.pgf 2014-04-11 20:08:12 +00:00
aarne
d8f15af8f0 Dut added to android Translator.java 2014-04-11 19:47:50 +00:00
aarne
3740a30f05 App11.pgf in Makefile 2014-04-11 18:56:59 +00:00
hallgren
ba825ae81a Wide Coverage Demo App (gftranslate.js): use a special lexer for Chinese. 2014-04-11 18:39:12 +00:00
hallgren
6601a3972e Simple Translator: use colors to indicate translation quality 2014-04-11 15:00:15 +00:00
aarne
aca589d872 experimental AppDut added 2014-04-11 07:49:34 +00:00
kr.angelov
7c3d97e72a named entities in the Android App 2014-04-11 12:56:31 +00:00
hallgren
ea389df58e Simple Translator: Use PGF API for (un)lexing instead of separate server calls
Also,

  + Get up to 10 (instead of 5) alternative robust translations.
  + Remove duplicates from list of alternative robust translations
  + Add GF Cloud logo to the simple translator page
2014-04-11 12:10:05 +00:00
kr.angelov
f72fe45c32 forgoten Completer.java 2014-04-11 07:52:10 +00:00
kr.angelov
b82f9a5035 expose Java API for word completion 2014-04-11 07:50:22 +00:00
kr.angelov
65b4ba2459 change the JVM version to 1.6 in JNI_OnLoad 2014-04-11 07:15:27 +00:00
kr.angelov
dbc8a6f579 bugfix in the Java binding 2014-04-10 16:43:40 +00:00
hallgren
4008a2b111 PGF web service: disable caching of parse results
Caching parse results uses a lot of memory, even if they expire after
2 minutes, so it won't scale up to many simultaneous users.

But some excessive memory use seems to be caused by space leaks in
(the Haskell binding to) the C run-time system, and these should be fixed.
For example, flushing the PGF cache does not release the memory allocated
by the C run-time system when loading a PGF file.
2014-04-10 15:55:33 +00:00
hallgren
5f75baf56a Wide Coverage Demo App: it now works ok without server caching of parse results 2014-04-10 15:50:34 +00:00
kr.angelov
1ca09448f9 now fully functional Java API for custom literals 2014-04-10 14:14:31 +00:00
kr.angelov
348c9c4233 bugfix in the C runtime 2014-04-10 07:42:49 +00:00
aarne
d7ef5d8c0b improved generation of BNC dictionaries ; now called TopDictionary for clarity 2014-04-10 13:07:05 +00:00
kr.angelov
d9f4c1598c a quick hack to enable the NERC from bindings. This should be made available from the API but for now I just hacked the C runtime 2014-04-10 07:27:07 +00:00
hallgren
d19e6d9d07 Wide Coverage Demo App: new buttons: to switch colors on/off & to try Google Translate 2014-04-09 20:51:31 +00:00
hallgren
402cccc3ca localstorage.js: bug fix
If you stored "false" and tried to retrieve it with a default value, you got
the default value instead of "false".
2014-04-09 20:49:53 +00:00
hallgren
96f36d8f0a Wide Coverage Demo App: use PGF service lexing/unlexing
It is now enough to make one server call per translation, and the results can
cached by the browser.
2014-04-09 19:49:45 +00:00
hallgren
d1da0e06de PGF web service: add unlexers and enable client side caching
Most PGF web API commands that produce linearizations now accept an
unlexer parameter. Possible values are "text", "code" and "mixed".

The web service now include Date and Last-Modified headers in the HTTP,
responses. This means that browsers can treat responses as static content and
cache them, so it becomes less critical to cache parse results in the server.

Also did some cleanup in PGFService.hs, e.g. removed a couple of functions
that can now be imported from PGF.Lexing instead.
2014-04-09 17:51:25 +00:00
hallgren
50ea3d265c Change the type of PGF.Lexing.bindTok to [String] -> [String]
The old type was [String] -> String. This function was only used
in GF.Text.Lexing.stringOp, which now uses (unwords . bindTok) instead,
with no change in behaviour.
2014-04-09 17:39:21 +00:00
hallgren
677d849840 Unlexers: move capitalization of first word from GF.Text.Lexing to PGF.Lexing
The capitalization of the first word was done in GF.Text.Lexing.stringOp,
but is now done in the functions unlexText and unlexMixed in PGF.Lexing.
These functions are only used in stringOp and in PGFService (where the change
is needed), so the subtle change in behaviour should not cause any bugs.
2014-04-09 17:26:23 +00:00
hallgren
04a6260eea PGF Service: a bit more clever lexer=text
Only change the first word to lowercase if the original input is not found in
the grammar's morphology. This allows parsing of sentenses starting with "I" in 
English, nouns in German and proper names in other languages, but it can make
the wrong choice for multi-words.
2014-04-09 14:13:18 +00:00
hallgren
4479bb81b7 Wide Coverage Demo App updates
+ Add Clear button.
+ Use localstorage to remember entered text between visits.
+ Add a link to it on the GF cloud service start page.
2014-04-09 13:59:35 +00:00
aarne
88cf84613e more passives in App. Import changes are now produced with MkApp.hs, which copies the exclude list from App.gf to the concrete syntax files. 2014-04-09 14:01:06 +00:00
aarne
a3921bffd7 rewrote App so that it just inherits Translate and excludes some functions. This minimizes the duplication of code between Translate and App. Also added some functions, which make App 15% slower but increase the coverage and quality. This trade-off has to be studied further. 2014-04-09 13:04:19 +00:00
hallgren
622ab0b44c Fix build problem in PGFService.hs when configured without c-runtime 2014-04-08 20:45:54 +00:00
hallgren
29efca71cb PGF web service: add lexer support
The PGF web API commands parse, translate, translategroup, c-parse and
c-translate now support a lexer parameter. Possible values are "text",
"code" and "mixed".

This is used in the Wide Coverage Demo App to save one server roundtrip.
2014-04-08 16:10:33 +00:00
aarne
44521edd2d small fixes in App grammar - don't affect performance 2014-04-08 16:14:05 +00:00
hallgren
9cac98a356 Move basic lexing functions from GF.Text.Lexing to the new module PGF.Lexing
They are thus part of the PGF Run-Time Library, making it possible to add
lexing functionality in PGF service in a natural way.
2014-04-08 14:07:49 +00:00
hallgren
936f3d8297 Wide Coverage Demo App: remove quality markers ("+" or "*") before unlexing
Otherwise the first word won't be capitalized.
2014-04-08 13:46:57 +00:00
kr.angelov
a90756aeda added preliminary API for custom literals from Java. Not functional yet 2014-04-08 13:54:49 +00:00
kr.angelov
f99d3033aa bugfix in the C runtime that shows up with only some grammars 2014-04-08 12:41:41 +00:00
hallgren
64623d4881 Wide Coverage Demo App: restore swap button 2014-04-08 11:32:54 +00:00
hallgren
c8a8883df8 demos/translation.t2t: more space for the demo app 2014-04-07 13:01:00 +00:00
hallgren
5868118ea9 Wide Coverage Demo Web App: add segmentation
Click on sentences to choose among alternative translations.
2014-04-07 12:51:13 +00:00
kr.angelov
e3d49bea01 Expr and ExprProb are now serializable objects 2014-04-07 12:52:51 +00:00
kr.angelov
317d32aa93 fix in the keyboard 2014-04-07 12:42:02 +00:00
kr.angelov
3ff5557389 added alternative_item.xml 2014-04-07 12:41:23 +00:00
kr.angelov
8fa202613f a bit more text in the help 2014-04-07 09:43:20 +00:00
kr.angelov
419aab3025 show alternative translations on Android 2014-04-07 09:14:14 +00:00
hallgren
a0adabb3a1 Wide coverage demo app: show an error message even if the error string is empty 2014-04-06 23:44:31 +00:00
hallgren
ea67953012 Wide coverage demo app: show an error message if linearization fails 2014-04-06 23:13:18 +00:00
hallgren
5344d42536 gftranslate.js: use Translate10.pgf 2014-04-06 19:59:04 +00:00
hallgren
d6d056034b TypeCheck.RConcrete: contravariance in table types 2014-04-04 16:50:12 +00:00
aarne
ad5f7397ad path in AppFin 2014-04-04 14:32:36 +00:00
aarne
1bd5bcfad3 polarities restored in Hin translation 2014-04-04 12:05:20 +00:00
hallgren
c58649bd29 Removed imports of TypeCheck.Concrete, fixed problems in TypeCheck.RConcrete
+ The current type checker for concrete syntax is in
  GF.Compile.TypeCheck.RConcrete, but GF.Compile.TypeCheck.Concrete was
  still imported in GFI.

+ Fixed a bug that allowed Ints n as a subtype of Ints m, regardless of
  m and n. It now requires n<=m. Note: the type checker still allows Int
  as a subtype of Ints m, regardless of m.

+ Fixed a potential efficiency problem with large record types, by reducing
  the number of recursive calls from |R|*|S| to |R| when checking if R<=S.

+ Fixed a misleading comment: "alpha g t u" checks that u is a subtype of t,
  the other way around. Similarly, "checkIfEqLType gr g t u trm" checks that
  u is a subtype of t, not the other way around, and not that t is equal to u.
2014-04-04 13:51:07 +00:00
hallgren
8986541160 Wide Coverage Translation Web App: redesigned user interface
The layout now resembles a certain other online translation service.
The translation is started automatically after text is entered, no need to
press the Translate button.
2014-04-04 12:52:41 +00:00
hallgren
5cc0f39520 gftranslate.js: increase length limit from 200 to 500 encoded bytes 2014-04-04 12:39:36 +00:00
hallgren
6cbd1a753c Simple Translator: show more alternatives when using GF robust translation
The maximum number of alternatives shown has been increased from 2 to 5
although it can slow down translation.
2014-04-04 12:35:20 +00:00
hallgren
9ceadecf89 Slightly more informative error messages in translation web apps 2014-04-04 12:33:31 +00:00
hallgren
4018073bdb PGFService.hs: adapt to changes in the Haskell binding to the C run-time system
Parse errors used to cause crashes, but they are now handled and reported.
2014-04-04 12:28:00 +00:00
kr.angelov
bd892b8a1d fix the haskell binding to handle parse errors 2014-04-04 11:46:40 +00:00
aarne
dafaef7fec AdvS added to app 2014-04-04 07:30:06 +00:00
aarne
1af3bb65b4 text in app help 2014-04-04 07:28:55 +00:00
kr.angelov
67debbd8c3 now the output from the speech recognizer is editable with the keyboard 2014-04-04 09:04:00 +00:00
kr.angelov
2f6ee53ff6 add activity_help.xml 2014-04-04 07:51:05 +00:00
kr.angelov
2834d0b44d add the forgoten HelpActivity.java 2014-04-04 07:48:50 +00:00
kr.angelov
587b02a63b add touch feedback to the two buttons in the app 2014-04-03 20:30:23 +00:00
kr.angelov
3f99060252 added help view in the android app. The help itself is not very useful right now 2014-04-03 14:22:44 +00:00
kr.angelov
6a8f271ba5 GFTranslator to DGTranslator in a few more places 2014-04-03 14:06:26 +00:00
kr.angelov
ba5e918b69 remove the old android icon 2014-04-03 14:02:50 +00:00
kr.angelov
b7283ade9c change the project name to DGTranslator 2014-04-03 13:48:08 +00:00
kr.angelov
7a319e0794 a new icon and a new name for the DG Translator 2014-04-03 13:44:14 +00:00
aarne
942808bc84 added AdvVP and AdVVP to App 2014-04-03 07:25:57 +00:00
kr.angelov
e6f9143c63 bugfix in the keyboard translation 2014-04-03 06:14:15 +00:00
aarne
cae40d2b0e Android app sources in examples/app - read README for advice 2014-04-02 21:34:40 +00:00
kr.angelov
0a8034c008 fix in the keyboard XMLs 2014-04-02 20:05:16 +00:00
kr.angelov
b3ba3d3c1c initial binding to Prolog for the C runtime 2014-04-02 10:03:19 +00:00
aarne
d4cbadb6ad use chunking before morpho lookup in backup parsing ; show results with unknown linearizations in darkest red 2014-04-01 16:24:35 +00:00
hallgren
23c9a042cb Bug fix for pattern macros in pre{}
This bug was introduced sometime between 2013-08-21 and 2013-11-01 and caused
the function convertTerm in GF.Compile.GeneratePMCFG to encounter a EPatt where
it expected Strs. I fixed it by applying the function getPatts (from the old
partial evaluator) to the pattern.
2014-04-01 10:54:41 +00:00
aarne
13d4e01ecb Hin and Bul keyboards in app restored 2014-03-31 19:45:41 +00:00
hallgren
57b2a2bc2c Wide coverage demo web app: green translations from Phrasebook.pgf
The demo web app now show translations from Phrasebook.pgf in green before
translations from Translate8.pgf, which can be yellow or red.
2014-03-31 15:28:14 +00:00
aarne
2a6cbe9a46 room_N in DictionaryChi 2014-03-31 14:30:31 +00:00
hallgren
98d9946ac4 Wide coverage demo web app improvements
+ Adapt language selection menus to the languages supported by the grammar.
+ Add translation quality colors to the links to alternative translations.
+ Also added more country codes in langcode.js (needed for speech synthesis
  voice selection).
2014-03-28 14:56:56 +00:00
aarne
035d367b1f added the phrase "what time is it" in ten languages. For simplicity, this is a Greeting and not a Question, which means that it has a variant appearing with ! rather than ? , similar to "how are you". Correcting this would require analysing the structure of the phrase so that it can be constructed in QS. 2014-03-28 08:02:14 +00:00
hallgren
201283c055 Wide coverage demo web app: translation quality feedback with colors
The background color of the translation changes to pale green, yellow or red
according to the quality.

Two types of quality indications are supported:

+ From the grammar: linearizations starting with "+" or "*" are assumed to
  be of high or low quality, respectively.
+ From the parse tree: if the root function is "?", then the translation is
  assumed to be of low quality.

If no quality indications are detected, medium quality is assumed.
2014-03-27 15:11:02 +00:00
hallgren
9bfed99790 support.js & gftranslate.js: improved handling of server errors
In support.js, the functions http_get_json, ajax_http_get_json
and ajax_http_post_json now calls the supplied error callback if the server
returns invalid JSON (e.g. because of a crash).

The function gftranslate.translate in gftranslate.js returns
a JSON value containing an error message (since it doesn't have an error
callback).

This should result in fewer situations where "nothing happens" and the user
doesn't know if it is beacuse the server is slow, or if there was an error.
2014-03-27 15:02:27 +00:00
kr.angelov
911ae42296 small fixes in the C runtime 2014-03-25 13:57:57 +00:00
kr.angelov
51a9ef72c7 refactor the compilation of CFG and EBNF grammars. Now they are parsed by using GF.Grammar.Parser just like the ordinary GF grammars. Furthermore now GF.Speech.CFG is moved to GF.Grammar.CFG. The new module is used by both the speech conversion utils and by the compiler for CFG grammars. The parser for CFG now consumes a lot less memory and can be used with grammars with more than 4 000 000 productions. 2014-03-21 21:25:05 +00:00
kr.angelov
d816c34986 added hasLinearization method in the Python binding 2014-03-20 14:48:47 +00:00
kr.angelov
eb1aa24896 fix in the Python binding which was forgoten after a change in the C runtime 2014-03-20 14:48:02 +00:00
hallgren
b061d59044 gf -server: add a command to manually flush the PGF cache
This can be used if the cloud service seems slow, but it would probably
be better to automatically expire unused PGFs from the cache after some time.
2014-03-19 16:15:05 +00:00
aarne
cbb538e170 a darker red in translation app: dictionary lookup for each word, identity if lookup fails 2014-03-18 13:22:13 +00:00
aarne
b4a6e047e3 Hin and Ger added to android app again 2014-03-18 10:21:53 +00:00
kr.angelov
a1446b87fa whitespace cleanup in the parser 2014-03-18 10:19:35 +00:00
aarne
891ca74186 show the value in the error message when failing to get Str from value 2014-03-17 18:02:07 +00:00
hallgren
22b68ad30c Wide coverage demo web app: add speech synthesis
Works in Safari and Chrome.
2014-03-17 15:59:43 +00:00
hallgren
825e0cf7cf doc/Logos/gf1.svg: variant of the GF logo with a subtle shadow 2014-03-13 14:50:30 +00:00
kr.angelov
7dd5748fa8 bugfix in the compiler for linref of empty record 2014-03-15 11:33:54 +00:00
aarne
55e2bfb9eb bg in android app 2014-03-14 15:00:33 +00:00
aarne
7899bb8cbe moved the small app chunking grammars from lib/src/experimental to examples/translator; the proper place might be in the git contributions, but this can be decided later 2014-03-14 13:28:42 +00:00
aarne
566df8e4ae Spanish in android app 2014-03-14 09:45:46 +00:00
aarne
c1c37a65e6 AppIta, with a small lexicon 2014-03-13 13:27:51 +00:00
hallgren
f6c7094955 GF home page: news item about Digital Grammars 2014-03-13 13:15:43 +00:00
aarne
f12aed25ca App ported to Fre 2014-03-13 11:12:34 +00:00
kr.angelov
bde1ff8032 remove accidental trace message 2014-03-13 08:25:19 +00:00
kr.angelov
cf1cee3c02 small stylistic changes in the Android App 2014-03-13 08:21:31 +00:00
kr.angelov
ae1512c926 compute the right word probability 2014-03-12 15:36:40 +00:00
hallgren
ca8dd1e8cc support.js: For better error handling, always use AJAX, don't fallback to JSONP
Cross-origin requests are allowed by the PGF service and are supported in
all modern browsers.
See http://en.wikipedia.org/wiki/Cross-origin_resource_sharing
2014-03-12 14:07:35 +00:00
hallgren
f092e7fe5b haskell-bind: comment out superfluous imports 2014-03-12 13:21:47 +00:00
kr.angelov
80331889e5 the UI for the Android API now has stable word prediction 2014-03-12 14:01:22 +00:00
kr.angelov
ebb61fbf1c ensure that negative probabilities are always avoided 2014-03-12 13:11:23 +00:00
john.j.camilleri
f4be97c152 Fix typo in PGFService: "incomlete" 2014-03-12 12:45:32 +00:00
kr.angelov
42e185124e remove the unnecessary logging of the completion string 2014-03-12 10:57:11 +00:00
kr.angelov
23f603dabc fixes in the word completion 2014-03-12 10:54:29 +00:00
hallgren
ccc43b28f0 WebSetup.hs: use the correct --gf-lib-path when building example grammars
The directory should be the same as the one used in Setup.hs when building
the RGL, where a build directory supplied by cabal is used. This is usually
dist/build/rgl, but it could be different, e.g. when using a cabal sandbox.
2014-03-11 13:46:10 +00:00
aarne
ccda8f00e1 android: added (1) dg icon (2) green/yellow/red colours for translation confidence (3) App grammars as test case in Translator.java 2014-03-10 18:04:43 +00:00
aarne
2ee2769146 reference to DictEngChi changed to DictionaryChi 2014-03-10 18:00:15 +00:00
aarne
0537de6726 added alternative build with Pred grammars to android, commented out by default 2014-03-09 11:42:47 +00:00
kr.angelov
178d06d5a2 added word completion in the Android UI 2014-03-07 21:30:54 +00:00
kr.angelov
2132eb6bed added Java API to the simple word completion 2014-03-07 21:29:26 +00:00
kr.angelov
319308007c fix in the Java binding after the implementation for pre 2014-03-07 21:28:40 +00:00
kr.angelov
ba28cfd80e added pgf_lookup_word_prefix which makes it possible to do simple word prediction 2014-03-07 21:24:20 +00:00
kr.angelov
ae59508f6a another fix in the keyboard 2014-03-07 14:13:21 +00:00
kr.angelov
a8e18c3bdf bugfix in the keyboard 2014-03-07 13:51:28 +00:00
kr.angelov
df3406c11f added Devanagari keyboard for Android 2014-03-07 13:42:13 +00:00
kr.angelov
6cb693bdf5 bugfix in pgf-translate 2014-03-07 09:35:57 +00:00
hallgren
052ead6797 C run-time: protect from Windows specific #includes with #ifdef __MINGW32__ 2014-03-06 13:42:27 +00:00
kr.angelov
e916c77cb4 bugfix in the android keyboard for multiline documents 2014-03-05 13:42:55 +00:00
kr.angelov
459f3bffa6 bugfix in the Android UI 2014-03-05 12:50:36 +00:00
kr.angelov
4f9afb9343 implementation for pre in the C runtime 2014-03-05 10:17:42 +00:00
hallgren
d04ffb60ac Fix the fix 2014-03-04 14:35:14 +00:00
hallgren
108e04b7bd Fixes for GHC 7.6 compatibility 2014-03-04 14:28:44 +00:00
hallgren
76ba865c2e Three fixes for compatibility with GHC 7.8
Two of the fixes were in the custom version of the binary package. We
should get rid of it at some point, to reduce the maintenance burden.

The third fix was to add new version constraints for happy and alex in
gf.cabal. New versions of them are needed because of the ugly, low-level,
GHC-specific code they produce need to be different for GHC 7.8.

More fixes might be needed for -server mode, but the cgi package is not
compatible with GHC 7.8 at the moment, so it will have to wait.
2014-03-04 14:13:41 +00:00
kr.angelov
cbe17732a6 use pgf_linearize instead of pgf_lzr_linearize_simple in pgf-translate.c 2014-03-04 10:30:23 +00:00
kr.angelov
2e1dd543e9 memory leak in parseval.c 2014-03-04 10:29:18 +00:00
kr.angelov
c197de7fbd rename pgf_lzr_linearize_table to pgf_lzr_get_table 2014-03-04 10:13:23 +00:00
kr.angelov
ddf36bcd62 more in src/runtime/java/INSTALL 2014-02-27 21:21:19 +00:00
kr.angelov
60bfacf7c2 another fix for building the Java binding 2014-02-27 21:20:19 +00:00
kr.angelov
aeeabe3f0e added file with instructions for compiling the Java binding 2014-02-27 20:20:59 +00:00
kr.angelov
994d936ce9 instructions for compiling the C runtime on Windows 2014-02-27 20:04:30 +00:00
kr.angelov
2eaf51f15a changes in Makefile.am to make it easier to compile the C runtime on Windows 2014-02-27 19:37:10 +00:00
kr.angelov
2238d1e462 include malloc.h in a few places to avoid warnings on Windows 2014-02-27 19:34:14 +00:00
kr.angelov
b87104aa89 update the Eclipse project for jpgf with settings needed for Windows 2014-02-27 19:28:25 +00:00
kr.angelov
6a044edc39 bugfix with the keyboard label for Chinese 2014-02-25 12:15:29 +00:00
kr.angelov
d1a65d6aec the Android UI uses a new progress indicator which works on both Nexus 1 and Nexus 7 2014-02-25 09:46:05 +00:00
kr.angelov
e5a6592080 the Android App is now using the documentation modules instead of xml files for generating the inflection tables. The xml files are removed 2014-02-21 16:34:59 +00:00
hallgren
9b1b42bd22 Wide coverage demo web app: add link to Google Translate 2014-02-19 14:17:49 +00:00
hallgren
62dcb1e14a src/www/js/langcode.js: functions for converting language codes
factored out from src/www/translator/translator.js
2014-02-19 14:15:14 +00:00
kr.angelov
1ec7065fb3 bugfix in the android ui 2014-02-18 13:09:56 +00:00
kr.angelov
5b97e9637b fix in GF.Compile.Compute.ConcreteNew which makes it possible to compile DocumentationBul.gf 2014-02-17 09:00:14 +00:00
hallgren
29ac39c5cc demos/translation.t2t: the translation app needs more space 2014-02-13 12:02:10 +00:00
hallgren
2a130d7565 Wide coverage demo: show up to 10 translations
The translations are loaded one at a time so you don't have to wait for all
10 to see the first one.
2014-02-12 16:08:18 +00:00
hallgren
44ee072331 Work on web api & apps based on the C run-time system
+ PGFService.hs: add command c-grammar, include probability in parse results
+ js/gftranslation.js: add start position and limit parameters, return more
  info to applications
+ Simple Translator: show two wide coverage translations
+ Wide coverage demo: show parse tree and probability (intended as grammar
  debugging aids)
2014-02-11 16:43:29 +00:00
hallgren
23dc22cea4 GFServer.hs: avoid intertwined log messages from parallel requests 2014-02-11 14:22:12 +00:00
hallgren
c9af5d11c0 Restore compatibility with GHC 7.0 2014-02-10 21:44:34 +00:00
hallgren
60980d1617 Fix broken C runtime support in gf.cabal and PGFService.hs
Also add PGF service command c-flush to explicitly flush cached parse results
from memory.
2014-02-10 16:04:40 +00:00
kr.angelov
44a764cd2f proper error checking in the C runtime 2014-02-10 14:07:17 +00:00
hallgren
1bcb2d06e3 haskell-bind: fix broken pgf-shell
The type CId was replaced with String, so can't use show and read anymore.
2014-02-10 12:59:31 +00:00
kr.angelov
5818b0fe1b bugfix in pgf2-bind.cabal 2014-02-10 10:28:19 +00:00
aarne
6faaa795c5 disabled ad hoc overloading, as it still causes mysterious errors. It is just a few lines in Rename.hs 2014-02-09 19:55:17 +00:00
kr.angelov
1746e3ad2a updated haskell-bind/README 2014-02-09 20:56:01 +00:00
kr.angelov
adeeb47e06 cleanup the code for the FFI binding. The API is now more uniform with the Python and the Java bindings. Fixed a lot of memory leaks. 2014-02-09 20:45:11 +00:00
kr.angelov
f30c60c3d7 GuVariant is now plain uintptr_t instead of a structure to make it easier to write Haskell bindings 2014-02-09 19:07:15 +00:00
hallgren
1d69feac38 gf.cabal: pgf-shell needs containers now 2014-02-07 16:42:51 +00:00
hallgren
680bf64454 pgf-shell: show the names of the concrete syntaxes after loading the grammar 2014-02-07 16:40:13 +00:00
inari
8de56530e0 haskell-bind: add function languages 2014-02-07 15:56:12 +00:00
hallgren
9a422839cc pgf-shell: enable -rtsopts, call performGC between commands
This is to make it easier to find the cause of space leaks.
2014-02-07 13:57:13 +00:00
inari
957dfb83b6 fixed some memory leaks 2014-02-06 10:50:59 +00:00
kr.angelov
f23bcb8a47 bugfix in the recognizer for literals in the C runtime 2014-02-05 20:13:52 +00:00
hallgren
edeb094cf5 PGF.Optimize: one more fix for unsafeFreeze 2014-02-04 13:47:37 +00:00
hallgren
9df56550cd PGF.Optimize: import unsafeFreeze from Data.Array.Unsafe for compatibility with ghc-7.8 2014-02-04 13:44:07 +00:00
hallgren
3900d3cfbb GFC.hs: encodeFile_ is not available in the standard Data.Binary 2014-02-04 13:36:16 +00:00
hallgren
c97e5f4086 gf.cabal: add default-language to silence warning 2014-02-03 12:24:42 +00:00
aarne
2aa8ad7e76 new overload resolution, taking care of ad hoc overloading. 2014-02-01 13:17:52 +00:00
aarne
6dba4e6f1e ad hoc overloading: a new way to deal with name resolution conflicts. Previously the renamer warned if there was e.g. an unqualified reference to mkAdv, which could come from either Syntax or Paradigms. The renamer picked randomly one of the alternatives, which then often failed in type checking. Now, all candidates are collected into a new structure AdHocOverload [Term], which is accessed by the type checker to make the choice based on the type of the constant. This eliminates some of the warnings and some of the error due to wrong choices. In some rare cases, the inherited constants have the same type, which cannot be resolved by overloading. In such cases, the type checker does the same as the renamer did before: pick the "first" option (i.e. the one that happens to be the first in the list returned by the renamer) and issues a warning. In this patch, only a couple of lines are changed. The typechecker (RConcrete) has more substantial changes, and will be recorded as the next patch. 2014-02-01 13:10:36 +00:00
aarne
d90eededaf typo in Concrete type checker: when type checking <e : t>, return annotated e and not e itself. Fixed in RConcrete, which should soon replace Concrete; and hopefully will be replaced by some cleaner code soon, such as ConcreteNew which has been under construction for quite some time. 2014-01-31 21:16:07 +00:00
aarne
6f03e517c8 experimental type checker module GF.Compile.TypeCheck.RConcrete.hs with record updates enabled by ** expressions. Can be changed back to Concrete.hs by just changing one import command in GF.Compile.CheckGrammar.hs. The worst thing that *should* happen with the new type checker is that some old code is detected to be invalid, which happens if it contains a type-incompatible record extension, e.g. {x = "foo"} ** {x = 1}. Previously such errors were silently ignored. A set of test runs detected one such error in the RGL, which was corrected. On the positive side, the new type checker now enables record updates in the natural way: R ** {x = 1} will give value x = 1 overshadowing any value of x in R (provided the expected type of x is Int). lib/src/experimental/PredicationSwe.gf illustrates this, as opposed to PredicationSwO.gf which has to use old-style copying of even the unchanged record fields. 2014-01-31 20:28:25 +00:00
hallgren
dbd68b987e gf-server.cabal: flag to include C run-time support in the FastCGI PGF service 2014-01-31 16:11:41 +00:00
kr.angelov
e6ab8c4aa4 fix in the bracketedLinearize in Haskell 2014-01-31 08:52:32 +00:00
inari
f0ddf0fe72 changes to pools in haskell bindings 2014-01-29 16:02:07 +00:00
hallgren
0386334f49 Wide coverage translation web demo improvements
+ Add lexing/unlexing
+ Add a button to swap input and output
+ Minor layout adjustments
2014-01-28 16:51:21 +00:00
hallgren
06bb2a1dad PGFService.hs: fix a type ambiguity when compiling without C run-time support 2014-01-27 16:46:48 +00:00
hallgren
b3251f402d PGFService.hs: add a cache for C run-time parse result and a start offset parameter
Cached parse results are discarded when they have been unused for 10 minutes.
2014-01-27 16:32:09 +00:00
hallgren
88341987a8 gf -server: fix a redirection bug...
...that was introduced with the recent changes to the handling of the
current working directory
2014-01-27 16:30:03 +00:00
hallgren
daa48610b5 gf -server: allow multiple PGF service requests to be handled in parallel
PGF service requests are stateless and can run in parallel, but some other
requests handled by the server are not and might even change the current
working directory temporarily, and this affects all threads, so it is
important that the PGF service requests access PGF files by absolute paths.
2014-01-24 13:49:02 +00:00
kr.angelov
55ea6cbec5 fix in the Haskell runtime 2014-01-24 08:34:55 +00:00
hallgren
77150e0b27 gf.cabal: bump version number to 3.5.12 2014-01-21 16:30:01 +00:00
hallgren
0a185814fd demos/translation: add preliminary online demo,
but it is not ready to be widely advertised yet, e.g. lexing and unlexing is
missing.
2014-01-23 14:56:52 +00:00
hallgren
14ce8509f8 simple translator: Replaced 'GF Robust Parser' with 'GF Wide Coverage Translation'
The interface to the wide coverage translation is in js/gftranslate.js
and it assumes that the grammar is installed on the cloud server
as /robust/Translate8.pgf.

The list of supported languages is hardwired in gftranslate.js, since
there is no support for obtaining this info from the C run-time system
at the moment.
2014-01-21 16:47:23 +00:00
hallgren
9d71ffc831 Optionally include C run-time support
If the C run-time library is compiled and installed on your system, you can now
do 'cabal configure -fc-runtime' to get the following extras:
  + The haskell binding to the C run-time library will be included in the
    PGF library (so you can import it in Haskell applications).
    Documentation on the new modules will be included when you run
    'cabal haddock'.
  + The new command 'pgf-shell', implemented on top of haskell binding to
    the C run-time system.
  + Three new commands in the web API: c-parse, c-linearize and
    c-translate. Their interfaces are similar to the corresponding commands
    without the "c-" prefix, but they should be considered preliminary.
2014-01-20 17:06:11 +00:00
hallgren
801a20d27a haskell-bind: add an export list to hide internal stuff
It also makes the generated haddock documentaiton more structured.
2014-01-20 14:40:38 +00:00
hallgren
d2d57a9210 haskell-bind.cabal: relax overly restrictive version bounds and add cc-options 2014-01-17 14:18:20 +00:00
hallgren
045eeeb280 haskell-bind: add a cabal file and examples/pgf-shell.hs
* The haskell-bind.cabal file makes it easy to build the haskell binding and
  use it in ghci.
* pgf-shell.hs is a simple example of how to use the haskell binding.
2014-01-17 14:02:35 +00:00
hallgren
b0a40d82b9 haskell-bind: change the type of CRuntimeFFI.getConcr
Change the type of getConcr from

    getConcr :: PGF -> Language -> Concr

to

    getConcr :: PGF -> Language -> Maybe Concr

This is to prevent programs from crashing later if you try to select a
concrete syntax that is not present in a grammar.
2014-01-17 13:58:48 +00:00
hallgren
41e3b28bfa examples/Phasebook/Makefile2: Lativan is fixed, include it again 2014-01-13 14:18:32 +00:00
normundsg
d89b5bd8c1 Phrasebook: Latvian is fixed (according to the latest RG) 2014-01-11 20:26:44 +00:00
aarne
b9a91b3c34 removed the generated html files 2014-01-10 14:55:21 +00:00
aarne
8b85e07561 started demo pages for translation and resource grammars 2014-01-10 14:54:21 +00:00
hallgren
ac33c8a851 examples/Phasebook/Makefile2: Lativan is broken, omit it for now
Also rewrote Makefile2 in a more compact way.
2014-01-10 13:26:42 +00:00
hallgren
ed3d30e3d1 Check file datestamp before creating PGF file when compiling grammars
When running a command like

	gf -make L_1.gf ... L_n.gf

gf now avoids recreating the target PGF file if it already exists and is
up-to-date. 

gf still reads all required .gfo files, so significant additional speed
improvements are still possible. This could be done by reading .gfo files
more lazily...
2014-01-09 17:30:24 +00:00
hallgren
768d9de668 Check file datestamps before unioning PGF files (fix)
Also check that no additional output formats have been selected.
2014-01-09 15:14:35 +00:00
hallgren
ed1e662dea Check file datestamps before unioning PGF files
When running a command like

 gf -make -name=T L_1.pgf ... L_n.pgf

gf now checks if T.pgf exists and is up-to-date before reading and computing
the union of the L_i.pgf files.

The name (T) of the target PGF file has to be given explicitly for this to work,
since otherwise the name is not known until the union has been computed.
If the functions for reading PGF files and computing the union were lazier,
this would not be necessary...
2014-01-09 14:18:21 +00:00
hallgren
d8d78b6187 Release note updates and some other minor things 2013-12-18 16:22:59 +00:00
hallgren
52494afc50 PGFtoPython: add Python translations for nonExist, BIND and SOFT_BIND
Someone who is familiar with the Python translation should check this.
2013-12-18 15:31:39 +00:00
hallgren
4012fa15dd GF home page: use the SVG version of the GF logo in browsers that support it
It looks better on high resolution screens.
2013-12-18 12:01:15 +00:00
hallgren
e9e919e6e3 src/server/gf-server.cabal: compile it as a common library + executables 2013-12-17 15:55:14 +00:00
kr.angelov
c8b8ca33c6 bugfix in the android keyboard for the choice of language 2013-12-17 17:09:53 +00:00
kr.angelov
a2526e59cd show progress bar when translating or when reloading a language in the lexical activity 2013-12-17 16:21:56 +00:00
hallgren
9c43c2bae3 examples/phrasebook/Makefile2: Finnish needs a larger stack 2013-12-17 15:13:44 +00:00
kr.angelov
ee37c6d34d bugfix for grammar loading if the start and the target language happen to be the same 2013-12-17 14:57:30 +00:00
kr.angelov
0c53711a44 partial grammar loading in the android app. From now on grammars for Android shall be compiled with -split-pgf 2013-12-17 14:00:17 +00:00
kr.angelov
a01e248ae6 make sure that pgf_concrete_load has no effect on grammars that are completely loaded 2013-12-17 13:57:16 +00:00
hallgren
e0481e3b8a Add backward compatibility for reading old PGF files
Some backwards incompatible changes were made to the PGF file format after
the release of GF 3.5. This patch adds a module for reading PGF files in the
old format.

This means that old PGF files on the grammaticalframework.org server will
continue to work after we install the latest version of GF.
2013-12-17 13:27:37 +00:00
hallgren
2b16962835 GF.Compile.ReadFiles: reduced code duplication 2013-12-16 14:04:57 +00:00
aarne
1010d357c5 ParseFin ProDrop variants ; ParseFre question word order and pronoun gender variants 2013-12-17 09:54:11 +00:00
hallgren
8455435b75 examples/phrasebook/Makefile2: remove duplicated rule 2013-12-16 13:41:29 +00:00
aarne
8736926a9a started DocumentationFre 2013-12-13 08:56:24 +00:00
hallgren
4811de89a4 GF home page: add a link to Grégoire's GF build status page
The link shows the current build status.
2013-12-12 20:54:59 +00:00
kr.angelov
3021570b1b allow the android app to be installed on the SD card 2013-12-10 20:06:39 +00:00
hallgren
dd1b474a22 testsuite: fix test of generate_trees
There were two differences between the current output and the old gold file: 

  1. The trees are no longer generated with increasing depth
  2. The meaning of the -depth flag has changed: for example, 
     "gt -cat=Nat -depth=1" used to generate only "zero",
     now you also get "succ zero".
2013-12-10 16:49:40 +00:00
kr.angelov
0851308099 move src/runtime/haskell/CRuntimeFFI to src/runtime/haskell-bind. Don't mess up with the stable Haskell runtime! 2013-12-10 16:11:47 +00:00
kr.angelov
97d56065c4 load/unload in the Java binding 2013-12-10 16:06:34 +00:00
inari
d7847f2f13 Haskell bindings for the C runtime
Added Haskell bindings for the C runtime. Work in progress, the files are not (and should not be) included in makefiles or anything.
2013-12-10 15:27:28 +00:00
kr.angelov
0ece8f19ab loading and unloading of languages in the C runtime and in the Python bindings 2013-12-10 15:00:52 +00:00
aarne
8121124d72 French inflection display in android 2013-12-10 13:03:50 +00:00
kr.angelov
4f0246cc12 bugfix in the grammar splitter 2013-12-10 12:31:40 +00:00
kr.angelov
87fffffbdf option --split-pgf replaces option --mk-index. This splits the PGF into one file for the abstract and one more for each concrete syntax. This is a preparation for being able to load only specific languages from the whole grammar. 2013-12-10 10:43:13 +00:00
aarne
2dda42e4d9 new inflection_fi.xml, for stemmed and refactored ParseFin 2013-12-09 14:48:19 +00:00
aarne
30511a600e make ParseFin compile with Construction 2013-12-07 08:01:28 +00:00
hallgren
953c6e8fb5 testsuite: reduced the number of failing tests from 25 to 13
Some tests may fail on Windows because of \ instead of / in paths.
2013-12-06 16:01:13 +00:00
hallgren
a98f4aa4be Show relative file paths in error messages
This is to avoid one trivial reason for failures in the test suite.
2013-12-06 15:43:34 +00:00
kr.angelov
e2fe50e585 partial reconstruction for sentence structures in Susanne 2013-12-06 15:05:56 +00:00
hallgren
71c1741046 GF.Compile.CheckGrammar: add source path to error message for circular definitions 2013-12-06 13:46:59 +00:00
hallgren
d6974a4065 GF shell: fix help text for generate_trees
Trees are not generated with increasing depth.
2013-12-06 13:45:12 +00:00
kr.angelov
0585428018 more on the Susanne treebank 2013-12-05 10:05:33 +00:00
kr.angelov
106b41a2cb added script for reading the Susanne treebank 2013-12-04 12:11:41 +00:00
hallgren
f5cda1e6a3 testsuite: Use Cabal's new test suite interface
* The old way: a user hook in Setup.hs
  * The new way: specify it in gf.cabal
  * The test suite is now called gf-tests, and it runs testsuite/run.hs.
  * You can run it manually with 'runhaskell testsuite/run.hs'. It also runs,
    together with rgl-tests, when you do 'cabal test'
  * Currently only 9 of 34 tests pass. Many failures have silly causes:
    - Error messages that look slightly different
    - Same output but in a different order
    - Absolute paths in output
2013-12-03 17:13:39 +00:00
hallgren
6b3ba6d3ba testsuite: use forward slashes in paths 2013-12-03 16:59:33 +00:00
aarne
2ef28487ef removed the unlines-lines wrapper from Lexing.unlexer to prevent empty lines when an unlexer (such as -bind or -unchars) is used as an option in linearization. Don't know really why the input had been broken into lines in the first place. You can see the effect by importing LangEng and running "gr -cat=Cl | l -table -bind" before and after recompiling GF. 2013-12-03 13:27:22 +00:00
kr.angelov
852f7483be fix in inflection_en.xml 2013-12-03 12:15:06 +00:00
aarne
fad27b1b4a ui/android/.../Translate.java uses Parse8 (change the name and language list if you need something else) 2013-12-02 13:34:51 +00:00
hallgren
91d8bd8e10 examples/phrasebook/Makefile2: Romanian needs a larger stack 2013-11-29 17:34:09 +00:00
hallgren
7d1c011389 Commment code and options relating to the old partial evaluator
This means that the -old-comp and -new-comp flags are not recognized anymore.

The only functional difference is that printnames were still normalized with
the old partial evaluator. Now that is done with the new partial evaluator.
2013-11-29 16:26:49 +00:00
hallgren
729d04051a Minor release/download/developer doc changes 2013-11-29 16:04:52 +00:00
hallgren
7ffdfe9b3a Move typePredefined from GF.Compile.Compute.AppPredefined to GF.Compile.TypeCheck.Primitives
Also move the list of primitives
2013-11-29 15:47:26 +00:00
hallgren
0a59f95d92 Move checkPredefError from GF.Compile.Compute.ConcreteLazy to GF.Grammar.Macros
Also simplified its type.
2013-11-29 14:43:01 +00:00
kr.angelov
1067d59609 -optimize-pgf should also apply to the linrefs 2013-11-29 14:25:23 +00:00
kr.angelov
870b073891 added caching to be able to quickly generate the inflection table for Finnish 2013-11-28 22:06:55 +00:00
hallgren
de33d7dd7c examples/foods: remove all -path flags
All languages n the Foods grammar compile fine with alltenses.
2013-11-29 13:03:19 +00:00
aarne
39cb49b05d added forms to Finnish xml table 2013-11-29 08:21:00 +00:00
aarne
f21928802f html templates for Finnish noun and verb inflection started 2013-11-28 22:04:30 +00:00
kr.angelov
ab0cd56b40 bugfix in the android app 2013-11-28 20:00:17 +00:00
kr.angelov
123d2098dd now the TTS is used only if there is actually a language model. this is better than using English for speaking Swedish 2013-11-28 19:59:03 +00:00
kr.angelov
2bc2dc750f a bit of cleanup in the Android app 2013-11-28 19:57:45 +00:00
kr.angelov
74de6c1097 extension in the template format for inflection tables. This makes it possible to use the templates with Finish 2013-11-28 19:52:31 +00:00
hallgren
ead60581af GFI: adapt to character encoding changes
GF.Compile.Coding is not used any more.
2013-11-28 13:55:08 +00:00
hallgren
29b1607f93 SimpleEditor.Convert: adapt to recent character encoding changes
Things got simpler!
2013-11-28 13:27:45 +00:00
kr.angelov
5475dd7613 the Android App now show the valency patterns for verbs in English, Bulgarian and Swedish 2013-11-28 12:48:55 +00:00
aarne
63e338cb80 Translate grammar for Ger and Hin added. Some functions in Ger phrasebook need to be commented out to compile. Now a system for 7 languages can be built, but including Fre as well is too heavy on my laptop although it can be compiled separately. 2013-11-28 08:03:50 +00:00
kr.angelov
f5ec987c5d better dictionary visualization in the Android App 2013-11-27 22:16:05 +00:00
hallgren
eea636966d Adding an alternate style for the GF home page 2013-11-27 15:32:25 +00:00
kr.angelov
47182d4045 minor tweaks in the Android UI 2013-11-27 12:37:55 +00:00
kr.angelov
d3e56a6e7e fix the character encoding problem in the web view in the Android UI 2013-11-27 12:37:15 +00:00
kr.angelov
b0a74ddc59 added API in the C runtime and the Java binding for checking whether a given function is linearizable in a given language. This is used in the Android UI for better vizualizations 2013-11-27 12:35:11 +00:00
kr.angelov
eeec31cbab update the project files for the Java binding 2013-11-27 12:34:33 +00:00
kr.angelov
7a428198c6 space leak in the Java binding 2013-11-27 12:34:06 +00:00
hallgren
3f57151cc3 Represent identifiers as UTF-8-encoded ByteStrings
This was a fairly simple change thanks to previous work on making the Ident
type abstract and the fact that PGF.CId already uses UTF-8-encoded
ByteStrings.

One potential pitfall is that Data.ByteString.UTF8 uses the same type for
ByteStrings as Data.ByteString. I renamed ident2bs to ident2utf8 and
bsCId to utf8CId, to make it clearer that they work with UTF-8-encoded
ByteStrings.

Since both the compiler input and identifiers are now UTF-8-encoded
ByteStrings, the lexer now creates identifiers without copying any characters.
**END OF DESCRIPTION***

Place the long patch description above the ***END OF DESCRIPTION*** marker.
The first line of this file will be the patch name.


This patch contains the following changes:

M ./src/compiler/GF/Compile/CheckGrammar.hs -3 +3
M ./src/compiler/GF/Compile/GrammarToPGF.hs -2 +2
M ./src/compiler/GF/Grammar/Binary.hs -5 +1
M ./src/compiler/GF/Grammar/Lexer.x -11 +13
M ./src/compiler/GF/Infra/Ident.hs -19 +36
M ./src/runtime/haskell/PGF.hs -1 +1
M ./src/runtime/haskell/PGF/CId.hs -2 +3
2013-11-26 16:12:03 +00:00
hallgren
9d7fdf7c9a Change how GF deals with character encodings in grammar files
1. The default encoding is changed from Latin-1 to UTF-8.

2. Alternate encodings should be specified as "--# -coding=enc", the old
   "flags coding=enc" declarations have no effect but are still checked for
   consistency.

3. A transitional warning is generated for files that contain non-ASCII
   characters without specifying a character encoding:

	"Warning: default encoding has changed from Latin-1 to UTF-8"

4. Conversion to Unicode is now done *before* lexing. This makes it possible
   to allow arbitrary Unicode characters in identifiers. But identifiers are
   still stored as ByteStrings, so they are limited to Latin-1 characters
   for now.

5. Lexer.hs is no longer part of the repository. We now generate the lexer
   from Lexer.x with alex>=3. Some workarounds for bugs in alex-3.0 were
   needed. These bugs might already be fixed in newer versions of alex, but
   we should be compatible with what is shipped in the Haskell Platform.
2013-11-25 21:12:11 +00:00
hallgren
3210a50648 examples/phrasebook: add Makefile2 for parallel grammar compilation
Makefile2 specificies the dependencies accurately enough that you can use
make's support for parallel compilation. Run

	make -f Makefile2 -j

to utilize all the cores in your computer to significantly speed up the
creation of Phrasebook.pgf.
2013-11-26 16:32:38 +00:00
hallgren
bfea06561d examples/letter: convert grammar files to UTF-8 2013-11-26 12:52:05 +00:00
hallgren
24a10d20a0 GF home page: mention upcoming default character encoding change 2013-11-25 20:11:11 +00:00
hallgren
cb27ed0a67 Setup.hs: avoid a problem with Cabal-1.18
In Cabal-1.18, the build command takes some new arguments. The Setup.hs script
should not die if these are present.
2013-11-25 20:03:57 +00:00
hallgren
9541668f76 Document the upcoming default character encoding change in the release notes 2013-11-25 19:47:05 +00:00
hallgren
4a82481a1f examples/phrasebook: adding --# -coding=latin1 to 18 modules
Adding coding pragmas
  
	--# -coding=latin1
    
so that grammars will continue to work when we change the default character
encoding to UTF-8.
2013-11-22 17:47:50 +00:00
hallgren
9c479393f6 examples/foods: add --# -coding=latin1
Adding coding pragmas

	--# -coding=latin1

so that grammars will continue to work when we change the default character
encoding to UTF-8.
2013-11-22 17:21:36 +00:00
kr.angelov
22fe61b533 fix in the GF keyboard for Android 2013-11-22 13:37:12 +00:00
kr.angelov
8cc6be0152 fix the export for CFG grammars with BIND, SOFT_BIND and nonExist 2013-11-22 13:36:14 +00:00
kr.angelov
8bcc70eac8 the GF syntax for identifiers is exteded with quoted forms, i.e. you could write for instance 'ab.c' and then everything between the quites is identifier. This includes Unicode characters and non-ASCII symbols. This is useful for automatically generated GF grammars. 2013-11-22 13:30:18 +00:00
kr.angelov
1d2786f7da bugfix in the debug mode for the parser 2013-11-22 12:26:49 +00:00
hallgren
260c0dfedc Some refactoring in GF.Compile and GF.Compile.GetGrammar
Move source transcoding function GF.Compile to GF.Compile.GetGrammar, in
preparation for doing transcoding before lexing.
2013-11-21 16:27:26 +00:00
hallgren
fe065b5ee4 Some more monadic lifting changes 2013-11-21 15:01:04 +00:00
kr.angelov
aad6a1c4bb bugfix in the C runtime 2013-11-21 14:31:28 +00:00
kr.angelov
a50724ca2c the Java binding for lookupMorpho should release the local references created in a loop 2013-11-21 14:29:47 +00:00
gregoire.detrez
57a48fea59 Add a test runner and a test suite fore the rgl
The test suite tests the French Bescherelle paradigms.
2013-11-21 09:55:30 +00:00
aarne
2b1794010e more stack in Translate Makefile 2013-11-20 12:48:53 +00:00
kr.angelov
9a2725279e fix in the Python binding 2013-11-20 09:54:37 +00:00
hallgren
308421789a Removed some code duplication in GF.Compile.Update 2013-11-20 01:26:41 +00:00
hallgren
018c9838ed Reduced clutter in monadic code
+ Eliminated vairous ad-hoc coersion functions between specific monads 
  (IO, Err, IOE, Check) in favor of more general lifting functions
  (liftIO, liftErr).
+ Generalized many basic monadic operations from specific monads to
  arbitrary monads in the appropriate class (MonadIO and/or ErrorMonad),
  thereby completely eliminating the need for lifting functions in lots
  of places.

This can be considered a small step forward towards a cleaner
compiler API and more malleable compiler code in general.
2013-11-20 00:45:33 +00:00
hallgren
ddac5f9e5a GF shell: improved system_pipe (aka "?") command
1. No temporary files are created.

2. The output of a system command is read lazily, making it feasible to 
   process large or even infinite output, e.g. the following works as
   expected:

	? "yes" | ? "head -5" | ps -lextext
2013-11-19 15:18:58 +00:00
kr.angelov
5b83da5583 bugfix in the robust parser 2013-11-18 09:05:27 +00:00
kr.angelov
edb4f7320d add gu_buf_insert in libgu 2013-11-18 09:05:09 +00:00
kr.angelov
a6d60f9c8d fixes in the C runtime to avoid warnings when compiling on MacOS 2013-11-15 10:03:22 +00:00
kr.angelov
d997df2864 pgf_read should open the grammar file in binary mode to prevent the Windows runtime from messing up the content. 2013-11-15 09:04:00 +00:00
kr.angelov
b3149b7897 pgf_reader_done should do nothing if the reading has failed 2013-11-15 08:59:18 +00:00
kr.angelov
2dadc3aa4c add additional options for compiling the Java binding on Windows (suggested by Normunds) 2013-11-15 07:48:02 +00:00
hallgren
982befac20 gfse: re-enable example-based grammar construction 2013-11-14 12:54:25 +00:00
kr.angelov
198f527255 add two files from the Android app that were forgoten 2013-11-13 17:27:11 +00:00
kr.angelov
126d5e0278 bugfix in the C runtime which had made the parser up to 200 times slower for some sentences 2013-11-13 15:15:28 +00:00
kr.angelov
7417326795 the dictionary view in the Android app now shows both the source and the target linearizations 2013-11-13 12:29:10 +00:00
kr.angelov
5f60445d2c minor bugfix in the translator keyboard 2013-11-13 10:59:03 +00:00
kr.angelov
ab1856046f now the Android App has a translation keyboard which allows the translations to be done from inside another application 2013-11-13 10:45:20 +00:00
hallgren
fa4c327463 Fix Issue 60: Weird output when executing system commands from the gf shell
The system_pipe (aka "?") command creates a temporary file _tmpi containing
the input of the system command. It *both* appends _tmpi as an extra argument
to the system command line *and* adds an input redirection "< _tmpi". (It
also uses and output redirection "> _tmpo" to captures the output of the
command.)

With this patch, the _tmpi argument is no longer appended to the command line.
This allows system_pipe to work with pure filters, such as the "tr" commands,
but it will no longer work with commands that require an input file name.
(It is possible to use write_file instead...)

TODO: it would also be fairly easy to eliminate the creation of the _tmpi and
_tmpo files altogether.
2013-11-12 18:07:38 +00:00
kr.angelov
0090b85002 document the four new language features in the reference manual 2013-11-12 16:05:02 +00:00
hallgren
709b2bb067 Fix Issue 68: Cannot use an overloaded operator in table defined using square brackets
Add proper type checking of course-of-values tables:

 + Make sure that all subterms have the same type.
 + Resolve overloaded operators.

Note though that the GF book states in C.4.12 that the "course-of-values
table [...] format is not recommended for GF source code, since the
ordering of parameter values is not specified and therefore a
compiler-internal decision."
2013-11-12 13:55:38 +00:00
hallgren
31d7a9f73c GF.System.Chatch: remove redundant #include 2013-11-12 13:51:11 +00:00
kr.angelov
0095119ec0 added Predef.SOFT_BIND. This special token allows zero or more spaces between ordinary tokens. It is also used in the English RGL to attach the commas to the previous word. 2013-11-12 09:54:57 +00:00
hallgren
b111b476a7 Fix Issue 41: "," in context-free rules causes parsing failure
The CF parser in GF.Grammar.CF assigns function names to the rules, but they
are not always unique, causing rules to be dropped in the follwing CF->GF
conversion. So a pass has been added before the CF->GF conversion, to make
sure that function names are unique.

A comment says "rules have an amazingly easy parser", but the parser looks
like quick hack. It is very sloppy and silently ignores many errors, e.g.
- Explicitly given function names should end with '.', but if the do not, the
  last character in the function name is silently dropped.
- Everything following a ';' is silently dropped.
2013-11-11 16:50:43 +00:00
hallgren
47e04656fb Fix issue 61: GF shell cannot parse a system command ending with a space
Trailing spaces caused the command line parse to be ambiguous, and
ambiguous parses were rejected by function readCommandLine, causing
the cryptic error message "command not parsed".
2013-11-11 15:13:24 +00:00
kr.angelov
af4a1f628d factor of 3 speedup for the translation without slowing down the grammar loading. The parser still seems to be 8 times slower than before I introduced the BIND. At least the Android UI now feels a lot more comfortable 2013-11-07 11:14:32 +00:00
kr.angelov
3f5ae22a0c bugfix in the binary search implementation in libgu 2013-11-07 11:13:47 +00:00
kr.angelov
7160a06a30 remove redundant type signature in gu/seq.h 2013-11-07 09:47:07 +00:00
kr.angelov
71744f7642 fix for the memory allocation in the jitter which should work for Windows. 2013-11-07 08:47:35 +00:00
kr.angelov
89ff9a0db4 the 'Release' configuration in Eclipse is renamed to 'Release (posix)'. In addition now there is 'Release (mingw)' for Windows. 2013-11-07 08:36:17 +00:00
kr.angelov
62dee6c805 added #ifdef to detect MinGW in the Java binding and to import the right header for alloca 2013-11-07 08:08:41 +00:00
kr.angelov
e79f39b774 more compact inflection tables for Swedish 2013-11-06 20:24:36 +00:00
aarne
fe4242275a changed startcat in Translate to get robustness; typo in DictEngSwe 2013-11-06 17:25:39 +00:00
aarne
a927944c80 added robustness flags to Translate; added or fixed a number of words in DictEngSwe detected in PhD regulations 2013-11-06 16:26:58 +00:00
hallgren
667a1c0ef0 minibar: fix a mistake the previous bracket fix 2013-11-06 16:54:21 +00:00
hallgren
72a58a8114 minibar: adapt to changed bracket structure in linearization output 2013-11-06 16:45:24 +00:00
kr.angelov
f9d044d294 fix in the parsing with pre 2013-11-06 16:25:25 +00:00
kr.angelov
2aea7ae3d5 added inflection_sv.xml 2013-11-06 14:46:57 +00:00
kr.angelov
7caf89b382 bugfix in the Java binding 2013-11-06 14:41:42 +00:00
hallgren
48660c219a Make PGF.Tree internal
The only use of PGF.Tree outside the PGF library was in GF.Command.Commands,
and it was eliminated by using PGF.Expr directly instead.
PGF.Paraphrase still uses PGF.Tree.
2013-11-06 14:29:17 +00:00
hallgren
7a41b45f13 Remove PGF.Signature
This module should not be part of the public PGF library API, and it was only
used in GF.CompileToAPI, so the code was moved there. The module defined
constFuncs and syntaxFuncs, but only syntaxFuncs was used.
2013-11-06 13:27:29 +00:00
kr.angelov
a710e90c0b fix the deserialization of flags from the GFO files 2013-11-06 13:05:51 +00:00
kr.angelov
b8fd12e5e4 use the inflection_cmn.xml in the Android translator 2013-11-06 11:00:39 +00:00
kr.angelov
2483dc7728 the content of ParseEngAbs3.probs is now merged with ParseEngAbs.probs. The later is now retrained. Once the grammar is compiled with the .probs file now it doesn't need anything more to do robust parsing. The robustness itself is controlled by the flags 'heuristic_search_factor', 'meta_prob' and 'meta_token_prob' in ParseEngAbs.gf 2013-11-06 10:21:46 +00:00
kr.angelov
84ef5fa5fa when printing floating literals use %lg instead of %lf for better output 2013-11-06 09:46:29 +00:00
aarne
e4c6ca41a7 added a -treebank option to the lc command 2013-11-05 20:42:22 +00:00
aarne
027ea81552 restored old language codes in android/.../Translator.java (committed by accident in previous patch) 2013-11-05 17:36:21 +00:00
aarne
aba666c5bc linearization by chunks in the GF shell: a new command 'lc' needed because 'l' requires type checking and trees with metavariable function heads don't type check. This will hopefully be a temporary command. 2013-11-05 17:28:47 +00:00
hallgren
3814841d7d Eliminate mutual dependencies between the GF compiler and the PGF library
+ References to modules under src/compiler have been eliminated from the PGF
  library (under src/runtime/haskell). Only two functions had to be moved (from
  GF.Data.Utilities to PGF.Utilities) to make this possible, other apparent
  dependencies turned out to be vacuous.

+ In gf.cabal, the GF executable no longer directly depends on the PGF library
  source directory, but only on the exposed library modules. This means that
  there is less duplication in gf.cabal and that the 30 modules in the
  PGF library will no longer be compiled twice while building GF.

  To make this possible, additional PGF library modules have been exposed, even
  though they should probably be considered for internal use only. They could
  be collected in a PGF.Internal module, or marked as "unstable", to make
  this explicit.

+ Also, by using the -fwarn-unused-imports flag, ~220 redundant imports were
  found and removed, reducing the total number of imports by ~15%.
2013-11-05 13:11:10 +00:00
kr.angelov
74357cdedf fix in gf.cabal. Data.Binary.IEEE754 needs to be in the other-modules list for the PGF library since otherwise building GF applications will fail 2013-11-05 09:42:22 +00:00
kr.angelov
6e1451e142 fix the debug mode of the JIT compiler after the refactoring in libgu 2013-11-04 19:33:29 +00:00
kr.angelov
546c7ac859 A simple type checker in the C runtime. Dependent types are not supported yet but HOAS is implemented. The API is accessible from Python as well 2013-11-04 17:10:46 +00:00
kr.angelov
585a192d0b bug fix in the linearizer 2013-11-04 12:40:53 +00:00
kr.angelov
a7d245fb25 linearization for HOAS trees. It should word but we need a type checker in order to test it properly 2013-11-02 12:34:00 +00:00
kr.angelov
4e7781b606 remove the include of lexer.h from pgf-parse 2013-11-02 11:28:55 +00:00
kr.angelov
523259b06d fix the parseval metric after the redesign in the C runtime 2013-11-01 17:36:22 +00:00
kr.angelov
fda1416c4d bugfix in the linearizer 2013-11-01 17:26:35 +00:00
kr.angelov
8073f9abf5 make gu_exn_is_raised non inlined. this is useful to make it callable from Haskell 2013-11-01 16:38:16 +00:00
aarne
d454165f24 left AR's translation project names in android/.../Translator.java as comments instead of leaving the changes uncommitted 2013-11-01 13:46:51 +00:00
kr.angelov
981a728d13 fix the robust parser for unknown tokens 2013-11-01 13:05:17 +00:00
kr.angelov
ad7d18a448 bugfix in linearizer.c 2013-11-01 11:02:12 +00:00
kr.angelov
a0505da063 remove the include to mman.h in jit.c since it doesn't seem to be used 2013-11-01 07:46:24 +00:00
kr.angelov
e1710542b4 add the forgoten close_arrow.png 2013-10-31 19:04:53 +00:00
kr.angelov
8325802c22 trim the input string in the conversation view for better lexical matching 2013-10-31 18:04:02 +00:00
kr.angelov
594c71f35d make the input mode in the Android translator persistent 2013-10-31 17:34:01 +00:00
hallgren
83a10ce25a Add a cabal flag to use the standard binary package
The standard binary package has improved efficiency and error handling [1], so
in the long run we should consider switching to it. At the moment, using it is
possible but not recommended, since it results in incomatible PGF files.

The modified modules from the binary package have been moved from
src/runtime/haskell to src/binary.

[1] http://lennartkolmodin.blogspot.se/2013/03/binary-07.html
2013-10-31 15:43:12 +00:00
kr.angelov
a7a1563b79 update the TAG for the MainActivity 2013-10-31 14:18:39 +00:00
kr.angelov
80143459c6 store the source and target languages for the Android UI in a preference file 2013-10-31 14:16:37 +00:00
kr.angelov
5e584c5c3f when the phone is in silent mode the UI should not use the TTS 2013-10-31 13:38:39 +00:00
kr.angelov
3e556355b0 fix the parsing error in the Android app 2013-10-31 13:22:53 +00:00
kr.angelov
20d465ca8c fixed utf-8 decoding problem in libgu 2013-10-31 13:20:12 +00:00
kr.angelov
050ebd469c bracketedLinearize in Python is now using the linref 2013-10-31 09:04:07 +00:00
kr.angelov
fed16ca9e5 use linref in the C linearizer. The robust linearization is now fully supported 2013-10-30 21:43:52 +00:00
kr.angelov
48b639e64e fix the debug mode in the linearizer after the refactoring in libgu 2013-10-30 21:06:55 +00:00
kr.angelov
a4194501fe linref is now used by the linearizer. The visible change is that the 'l' command in the shell now can linearize discontinuous phrases 2013-10-30 14:42:29 +00:00
hallgren
5bc9e959d0 GF home page: comment out news from 2012-11 and older 2013-10-30 13:52:42 +00:00
hallgren
bef74249cb release-next.t2t: add your notes for the next release of GF here
The file will be renamed when the release is made.
2013-10-30 13:44:10 +00:00
kr.angelov
042243f08a added the linref construction in GF. The PGF version number is now bumped 2013-10-30 12:53:36 +00:00
kr.angelov
122c40bb3b missing binary serialization for PImplArg in the .gfo files 2013-10-30 12:48:58 +00:00
gregoire.detrez
2e9992a9b3 Add Estonian to Setup.hs 2013-10-29 18:17:12 +00:00
kr.angelov
c60a019b70 another fix for 'pre' 2013-10-28 13:54:06 +00:00
kr.angelov
2355e32db8 fix inflection_en.xml 2013-10-28 12:37:37 +00:00
kr.angelov
151f86c1e9 fix the handling of 'pre' in the C runtime 2013-10-28 12:35:37 +00:00
kr.angelov
cd5a0de253 bugfix in gu/seq.h 2013-10-28 08:58:36 +00:00
aarne
9ff8c28676 Make entry for TranslateEngChiFinSwe 2013-10-27 16:34:05 +00:00
aarne
5be985f0c8 Phrasebook lin's that create punctuation and "please" for NP's overridden, to give uniformity to Translate translations 2013-10-27 15:42:54 +00:00
aarne
ccc18da2d4 added TranslateSwe to the Parse+Phrasebook translators 2013-10-27 15:17:10 +00:00
hallgren
9410c6b141 Functions merge trees into tries in the GF Shell and the PGF web service
* In the shell, the new command tt (to_trie) merges a list of trees into a
  trie and prints it in a readable way, where unique subtrees are marked with
  a "*" and alternative subtrees are marked with numbers.
* In the PGF web service, adding the parameter trie=yes to the parse and
  translate commands augments the JSON output with a trie.

Example to try in the shell:

	Phrasebook> p -lang=Eng "your son waits for you" | tt
2013-10-24 17:29:02 +00:00
hallgren
c2e977c67a Commands.hs: fix a copy-paste error in the documentation of put_tree 2013-10-24 14:32:11 +00:00
kr.angelov
ecaa05a3db added dummy inflection template for Chinese. It needs better names for the different inflection forms 2013-10-23 15:23:54 +00:00
kr.angelov
10fa2baa56 the first version of the Android's morphology browser 2013-10-23 15:10:13 +00:00
kr.angelov
0882396875 tabular linearization in the C and Java runtimes 2013-10-23 14:49:28 +00:00
hallgren
51bf4e0380 GF home page: update PGF library API link
GF 3.5 is now on Hackage and the automatic generation of Haddock documentation
succeeded for the first time in a long time!
2013-10-23 14:24:04 +00:00
kr.angelov
e408f0a0db clumsy fix for nonExist in pgf-translate 2013-10-21 12:35:34 +00:00
kr.angelov
53631576dc bugfix for the custom literals in the C runtime 2013-10-21 12:34:57 +00:00
kr.angelov
1d2bf1cea8 fix the grammar serialization for nonExist and BIND 2013-10-21 10:03:43 +00:00
aarne
df2e91154c news about Estonian 2013-10-18 12:02:00 +00:00
aarne
8e43ac968f completed PhrasebookChi with many expressions, using Google translate as main source 2013-10-12 20:32:05 +00:00
aarne
e50594a83c added TranslateChi and TranslateFin 2013-10-12 18:54:47 +00:00
kr.angelov
99309cf8fd add keyboard input in the android app 2013-10-12 12:28:23 +00:00
aarne
8fe119b4cc added links to main index.html 2013-10-11 12:58:53 +00:00
aarne
7f74cdcb76 Chi phrasebook bootstrapped from Tha; far from finished 2013-10-11 12:16:03 +00:00
aarne
75380bc0e4 harmonized the paths of Translate*.gf to guarantee the usage of the same DictEngAbs 2013-10-11 11:24:58 +00:00
aarne
3ca480f57d added TranslateBul and translator/Makefile 2013-10-11 08:36:09 +00:00
aarne
824cf32226 integration of Parse with Phrasebook, to get idiomatic translations whenever possible 2013-10-11 08:19:04 +00:00
kr.angelov
f358d37c4e synchronize the target languages in the main activity with the one in the lexicon activity 2013-10-11 08:16:51 +00:00
kr.angelov
c40c5022ca better lexicon view 2013-10-11 08:15:33 +00:00
kr.angelov
4d50c08714 make MorphoAnalysis serializable 2013-10-11 08:10:58 +00:00
kr.angelov
f7fb6fa5bc readExpr in the Java binding 2013-10-11 08:10:04 +00:00
aarne
a0e6576e45 added 'make ParseFre' and 'make ParseEngFre' to lib/src/Makefile; added the script french/MkWikt.hs 2013-10-10 23:32:05 +00:00
kr.angelov
482e8ef8cd an improvised dictionary mode in the Android translator 2013-10-10 15:39:52 +00:00
kr.angelov
c9b2e11782 added lookupMorpho in the Java binding 2013-10-09 19:39:50 +00:00
kr.angelov
f58d684ab4 fix in the Java binding 2013-10-09 19:37:57 +00:00
kr.angelov
268e9a7960 avoid warning in parser.c when debugging is OFF 2013-10-09 13:41:02 +00:00
kr.angelov
5dbed2d79b lexer.c is now exluded from the makefile for Android since the new runtime doesn't need lexing 2013-10-09 12:11:37 +00:00
kr.angelov
8cf03bc5b6 a major redesign in the C runtime. The parser and the linearizer now fully support BIND. The following things are still broken: parseval, word completion, handling 'pre', the robust mode 2013-10-09 12:08:51 +00:00
kr.angelov
20e4970ec1 added gu_is_space in gu/utf8.h. this helps to avoid the dependency on the broken unicode library for C. 2013-10-09 08:37:42 +00:00
kr.angelov
e7749d4a5b remove libjpgf.so from darcs 2013-10-08 14:13:00 +00:00
kr.angelov
ebb5737c0e fix the robust parser after the change of GuString 2013-10-08 15:00:42 +00:00
kr.angelov
977d309e3c rename the Android translator from GFVoiceExample to GFTranslator 2013-10-08 14:10:17 +00:00
kr.angelov
c63ca25a72 a quick hack in the Android translation for parsing Chinese 2013-10-08 14:08:40 +00:00
kr.angelov
4a50440db9 bugfix in GNU lightning for ARM 2013-10-08 13:33:18 +00:00
kr.angelov
7261134ad8 ensure that the grammar is loaded only once even if the main activity is recreated 2013-10-07 11:50:58 +00:00
kr.angelov
5041984e2d ensure that the grammar is loaded only once 2013-10-07 11:26:53 +00:00
kr.angelov
d327697605 in case of parse error report the token on Android 2013-10-07 10:11:41 +00:00
kr.angelov
8efe22542a remove the binaries for the grammar, the .so file and .jar file in the Android App. These should be compiled from sources 2013-10-07 09:58:47 +00:00
kr.angelov
dee84de3d6 remove the custom background in activity_main.xml since it is not backward compatible with older versions of Android 2013-10-07 09:57:24 +00:00
kr.angelov
c8df5997a7 fix the grammar printer after the change of GuString in libgu 2013-10-07 09:46:35 +00:00
kr.angelov
c015af71a1 remove the grammar copying from the Android UI since now we can load grammars from InputStream 2013-10-04 20:31:58 +00:00
bringert
a35b286ce0 Add new Android voice translator sample app
This adds a simple voice translator Android app that uses
the JNI bindings to the PGF C runtime.

Caveats:

- Since the C runtime doesn't compile for Android right now,
  I've bundled an old copy, along with its Java bindings.
  That should be removed once the C runtime compiels for Android
  again.

- Adding an automated build would be nice.

- Replacing the grammar requires editing a Java file, that should 
  really be more dynamic.
2013-10-04 16:26:46 +00:00
kr.angelov
f156a5e8f9 fixes in the Java binding after the refactoring of GuString 2013-10-04 19:53:19 +00:00
kr.angelov
73fa1ec0e6 suppress warning in graphviz.c 2013-10-04 12:56:45 +00:00
kr.angelov
e8335806af GuString is now an ordinary C string - it makes live easier. In addition PgfSymbolKS, PgfExprFun and PgfLiteralStr now keep their strings as embedded flexible arrays. The latest change gives us the same compactness as the old representation but it is a lot easier to use. 2013-10-04 12:04:39 +00:00
kr.angelov
27091048ce space leak in the Java binding 2013-10-03 21:00:45 +00:00
kr.angelov
71868fa053 the symbol for nonExist in the GF runtime should be the last. this simplifies the binary search in the C runtime 2013-10-03 08:21:31 +00:00
kr.angelov
bbf6bd52c0 something in the typeinferencer of the latest GHC has changed. I need to add a type signature for GF.Compile.GrammarToPGF.genCncFuns in order to compile. 2013-10-02 19:04:30 +00:00
kr.angelov
9303fe100f fix the bracketed linearization in Python after the introduction of nonExist and BIND 2013-09-30 11:49:51 +00:00
kr.angelov
f5d7b4787c fix the graphviz visualization after the introduction of nonExist and BIND 2013-09-30 10:38:28 +00:00
kr.angelov
4a06a6ecf2 the compiler now sorts the list of sequences in the PGF files 2013-09-23 13:13:59 +00:00
kr.angelov
13822c9a2d better handling for nonExist in the C runtime. BIND is also supported in the linearizer but not in the parser yet 2013-09-30 10:25:39 +00:00
hallgren
7c0936b7ce GF home page: minor style changes
+ Split the list of languages into several columns if space permits
  (in supported browsers, currently Firefox).
+ Limit the size of the GF logo to 75% of width the window. Looks better on
  small screens.
2013-09-29 16:25:16 +00:00
kr.angelov
426bc49a52 a major refactoring in the C and the Haskell runtimes. Note incompatible change in the PGF format!!!
The following are the outcomes:

   - Predef.nonExist is fully supported by both the Haskell and the C runtimes

   - Predef.BIND is now an internal compiler defined token. For now
     it behaves just as usual for the Haskell runtime, i.e. it generates &+.
     However, the special treatment will let us to handle it properly in 
     the C runtime.

   - This required a major change in the PGF format since both 
     nonExist and BIND may appear inside 'pre' and this was not supported
     before.
2013-09-27 15:09:48 +00:00
john.j.camilleri
b138899512 Rename README to READ_ME so that Apache doesn't hide it 2013-09-27 09:31:20 +00:00
john.j.camilleri
8f23ced7ad Remove empty contrib folder and place README in examples 2013-09-27 09:18:08 +00:00
kr.angelov
780ba65c25 remove pgf/edsl.h from the C runtime 2013-09-26 11:59:35 +00:00
kr.angelov
216490f275 add gu_variant_close in libgu 2013-09-26 10:41:52 +00:00
kr.angelov
2e2f74741a fix the debug mode of the parser after the refactoring in libgu 2013-09-25 10:21:35 +00:00
kr.angelov
4f05852b22 added assertion in the JIT compiler which checks that we are not going outside of the compilation window 2013-09-25 07:53:10 +00:00
kr.angelov
82815c8262 fix a typo in src/runtime/javascript/translator.html 2013-09-25 07:13:50 +00:00
kr.angelov
4baae48178 a small fix in the python binding after the refactoring in the C runtime 2013-09-24 09:14:43 +00:00
hallgren
95424190d1 Link to GF source code browser
And the summers chool and the Interactive map are not new anymore.
2013-09-23 13:07:24 +00:00
kr.angelov
1402225a6e GrammarToPGF now looks only at the top modules for the PGF flags 2013-09-23 09:30:45 +00:00
kr.angelov
54c3924a11 fix a warning in the compiler 2013-09-23 09:20:55 +00:00
kr.angelov
14061ef4df GF.Grammar.Grammar.allExtends now returns a list of source modules instead of just the module names. This saves extra lookups later 2013-09-23 09:18:27 +00:00
hallgren
9cbd28e9ce Comment out identifier refreshing code only used by the removed refresh pass 2013-09-20 16:36:24 +00:00
kr.angelov
9e148280c5 work on the translation dictionaries and the statistical model 2013-09-20 12:09:54 +00:00
hallgren
021b5f06d3 Introduce type RawIdent; only 9 imports of Data.ByteString.Char8 remain
The fact that identifiers are represented as ByteStrings is now an internal
implentation detail in module GF.Infra.Ident. Conversion between ByteString
and identifiers is only needed in the lexer and the Binary instances.
2013-09-19 20:48:10 +00:00
hallgren
3d5b9bd1fd Make Ident abstract; imports of Data.ByteString.Char8 down from 29 to 16 modules
Most of the explicit uses of ByteStrings were eliminated by using identS,

	identS = identC . BS.pack 

which was found in GF.Grammar.CF and moved to GF.Infra.Ident. The function

	prefixIdent :: String -> Ident -> Ident

allowed one additional import of ByteString to be eliminated. The functions

	isArgIdent :: Ident -> Bool
	getArgIndex :: Ident -> Maybe Int

were needed to eliminate explicit pattern matching on Ident from two modules.
2013-09-19 18:23:47 +00:00
kr.angelov
c08f42ce9f the PGF reader now releases strings that are not used after the loading 2013-09-18 08:26:11 +00:00
john.j.camilleri
2767e814f9 Add news item for gf-contrib on homepage 2013-09-18 08:20:47 +00:00
kr.angelov
a42cbb84ff add type signature for gu_string_length in the headers of libgu 2013-09-18 08:03:37 +00:00
kr.angelov
99985843d1 bugfix in the ordering of strings in libgu 2013-09-17 19:05:54 +00:00
kr.angelov
237c2af7fc gu_buf_binsearch -> gu_seq_binsearch. Improved API 2013-09-17 19:04:46 +00:00
kr.angelov
d1e6a9c2ba added order and equality for strings in libgu 2013-09-17 13:45:37 +00:00
kr.angelov
2a49e4e1d6 a major refactoring in the C runtime. GuList is now removed and replaced with GuSeq. The GuSeq/GuBuf API is simplified 2013-09-17 12:45:00 +00:00
john.j.camilleri
f5461eb3d4 Remove contribs and examples
Everything has now been moved to a separate repository at
https://github.com/GrammaticalFramework/gf-contrib
The contents of the examples folder are build during SetupWeb
2013-09-16 07:17:27 +00:00
kr.angelov
8e1c6cca40 added BSD licenses to the Java binding and the android UI 2013-09-16 06:54:55 +00:00
kr.angelov
470eb46e96 remove leftcorner_cat_idx which is now redundant 2013-09-13 13:49:17 +00:00
kr.angelov
c721c5548e minor optimization/refactoring in the grammar reader 2013-09-13 11:02:17 +00:00
kr.angelov
df91908e63 the leftcorner indexing is now completely removed since it slowed down the loading without speeding up parsing a lot 2013-09-13 10:26:33 +00:00
kr.angelov
4eb9aa3911 fix the debug mode of the parser after the changes in the libgu API 2013-09-13 09:58:20 +00:00
kr.angelov
ba60e6f0e4 tiny optimization in pgf/reader 2013-09-13 09:50:44 +00:00
kr.angelov
9da5ca7f81 bugfix in utf8.c 2013-09-13 09:50:04 +00:00
kr.angelov
d10a3830b8 fix a warning in utf8.c 2013-09-13 08:30:57 +00:00
kr.angelov
2e8f055164 optimize the reading of strings in the grammar loader. 2013-09-13 08:28:20 +00:00
kr.angelov
4d8ed02f6d more UTF8 cleanup 2013-09-13 08:12:19 +00:00
kr.angelov
c469ae9091 clean up the UTF8 API in libgu 2013-09-13 07:44:45 +00:00
kr.angelov
c684ab30a7 fix in Android.mk to make sure that the Android build will always see the ARM headers of GNU lightning 2013-09-12 12:55:55 +00:00
kr.angelov
9c3dd1e1e1 remove the logging from libgu 2013-09-12 09:30:02 +00:00
kr.angelov
2105188bd0 enable the PGF JIT compiler for Android 2013-09-12 09:05:43 +00:00
kr.angelov
bfafdbfec3 rewrite the ARM port of GNU lightning to a form compatible with the versions for the other CPUs 2013-09-11 20:17:50 +00:00
hallgren
8a3b97e6a5 Some code verbosity reduction 2013-09-10 14:19:11 +00:00
hallgren
aa9280b287 Workaround for a problem with lock fields
This problem showed up after delaing eta expansion until just before partial
evaluation
2013-09-10 13:43:59 +00:00
hallgren
b93f817058 new-comp: delay eta expansion until just before partial evaluation
This seems to work for the most part, but a problem showed up in WordsCat.gf in
the phrasebook.
2013-05-30 16:01:12 +00:00
hallgren
bf5dfb2293 Nonlinear patterns in concrete syntax are now detected and reported as errors
Before, they were silently converted to linear patterns.
Nonlinear patterns in MorphoCat.gf, ParadigmsGre.gf and ParadigmsFin.gf have
been make linear by renaming pattern variables.
2013-09-09 19:52:08 +00:00
hallgren
3543cb7a16 partial evaluator: prettier complaint about nonlinears patterns 2013-09-09 16:23:01 +00:00
hallgren
990789eb91 partial evaluator: complain about nonlinear patterns 2013-09-09 15:53:14 +00:00
hallgren
83283b0d6a Fix an old name shadowing bug in concrete syntax by removing the refresh pass
The refresh pass does not correctly keep track of the scope of local variables
and can convert things like \x->(\x->x) x into \x1->(\x2->x2) x2. Fortunately,
it appears that the refresh pass is not needed anymore, so it has been removed.
2013-09-09 14:29:57 +00:00
kr.angelov
5a4454aa8f added exhaustive generation in the Java binding 2013-09-06 07:21:38 +00:00
kr.angelov
14f8b96b56 remove the string internalization since it slows down grammar loading with little benefit 2013-09-05 13:34:49 +00:00
kr.angelov
46f2460a92 move src/runtime/android to src/ui/android/jni 2013-09-05 12:19:59 +00:00
hallgren
d7916c1b08 Fix an old bug that prevented pattern matching agains values containg tables
The function GF.Grammar.PatternMatch.isInConstantForm returned False for all
tables, causing matchPattern to fail, claiming that "variables occur in" the
term if it contains tables.

This problem is several years old, confirmed present in GF 3.2.10 (Oct 2010).
2013-09-05 15:20:41 +00:00
kr.angelov
f190e349c2 added version readPGF in Java which takes as argument InputStream. This makes it easier to load grammars from the assets folder in Android 2013-09-05 12:12:01 +00:00
kr.angelov
ebc3fc51d0 fix gu_in_bytes_ to use buffering 2013-09-05 12:10:55 +00:00
kr.angelov
7c0bad5092 remove the read and write modules from libgu. this simplifies the i/o layer 2013-09-05 11:20:39 +00:00
kr.angelov
504341dfba remove dump and yaml from libgu 2013-09-05 10:01:47 +00:00
kr.angelov
8f975239c6 bugfix for gu_buffered_in 2013-09-05 09:50:57 +00:00
kr.angelov
9b97346c07 add gu and pgf in the library path for building the Java binding 2013-09-04 20:30:43 +00:00
kr.angelov
bd2666eab4 added description file for building jpgf.jar 2013-09-04 18:48:51 +00:00
kr.angelov
1fdf0cbcfb fix the warnings from the Java binding 2013-09-04 18:23:49 +00:00
kr.angelov
b129eedcfa now it is possible to compile the C code for the Java binding from Eclipse. The old and broken Makefile is now removed 2013-09-04 18:09:06 +00:00
kr.angelov
2f02340d0d added Eclipse project for building the Java binding 2013-09-04 14:06:06 +00:00
kr.angelov
9f0f99bba4 fix a few warnings in the Java binding 2013-09-04 13:37:40 +00:00
kr.angelov
7c000467c9 updated files src/ui/android 2013-09-04 13:34:44 +00:00
kr.angelov
35a98594be added make file for compiling the C runtime for Android. The JIT compiler for Android is temporary disabled 2013-09-04 11:56:47 +00:00
kr.angelov
c837f3927e the code in the C runtime is now complete independent from config.h 2013-09-04 11:51:05 +00:00
kr.angelov
93cbfd31d1 remove the dependency on the CHAR_ASCII flag 2013-09-04 10:27:08 +00:00
kr.angelov
805f95eac6 remove the dependency on the HAVE_STATEMENT_EXPRESSIONS flag. This reduces the dependency on the ./configure script 2013-09-04 10:06:07 +00:00
kr.angelov
ae87c3d272 avoid using nan() in libgu for portability with Android 2013-09-04 07:36:39 +00:00
kr.angelov
0aef8d1c72 slight optimization for the linearizer in the C runtime 2013-09-04 07:11:14 +00:00
kr.angelov
69e71b6a4e bugfix in the robust linearizer 2013-09-04 07:05:27 +00:00
kr.angelov
027fd911b6 fix for linearization with 'pre' 2013-09-03 08:58:04 +00:00
kr.angelov
df26b134fc fix in the GF compiler and runtime which let us to define pre construct detecting whether this is the last token. 2013-09-03 07:51:25 +00:00
hallgren
d626a194de gf.cabal: version: 3.5-darcs 2013-09-02 20:27:47 +00:00
kr.angelov
eb013c0b06 almost functional version of the javascript runtime 2013-08-29 20:36:06 +00:00
kr.angelov
1da6b2a34a the PGF class is now using the new Pool class to manage the life time of the memory allocated in C. 2013-08-29 05:38:07 +00:00
kr.angelov
bb007630d7 more carefull tracking of references in the Java binding 2013-08-29 05:35:45 +00:00
kr.angelov
430e9c1b49 now Concr.parseBest throws ParseError 2013-08-28 15:35:57 +00:00
kr.angelov
69007cc661 bugfix which caused the runtime to crash on Android 2013-08-28 15:19:39 +00:00
kr.angelov
e1362fdb83 fix the error handling in the Java binding 2013-08-28 08:51:53 +00:00
kr.angelov
1c7a64acee make the Expr constructor private 2013-08-28 07:09:31 +00:00
kr.angelov
5a24be9735 fixes in the Java binding 2013-08-28 00:04:50 +00:00
kr.angelov
e3bd66cc78 added PGF.getStartCat() 2013-08-27 23:02:00 +00:00
kr.angelov
3494107994 added method for best first parsing in the Java binding 2013-08-27 22:54:10 +00:00
kr.angelov
e3c5882721 bugfix in the java binding 2013-08-27 22:53:38 +00:00
kr.angelov
e274cce213 linearization in the Java binding 2013-08-27 22:39:26 +00:00
kr.angelov
e1df8e713c small refactoring in the Java binding 2013-08-27 22:37:31 +00:00
kr.angelov
d3631d918d parsing from the Java binding 2013-08-27 21:53:13 +00:00
kr.angelov
d4289a6654 comparison for strings in libgu 2013-08-27 08:07:18 +00:00
kr.angelov
297587fa38 quicksort and binary search for buffers in libgu 2013-08-27 08:06:34 +00:00
gregoire.detrez
b94fd42957 Remove script (moved to an other repository) 2013-08-26 12:30:47 +00:00
kr.angelov
a20cd77d25 nonExist now does the expected thing 2013-08-23 13:17:45 +00:00
john
7c98267193 Add INSTALL file for python bindings. Add note about libtool to INSTALL of c runtime 2013-08-23 13:06:58 +00:00
hallgren
018b43837b Demo page: added a link to Phrasomatic 2013-08-22 19:27:33 +00:00
gregoire.detrez
8d873c8a32 Add vim and eclipse in the page about editor modes (fix) 2013-08-22 15:26:26 +00:00
gregoire.detrez
179143ae31 Add vim and eclipse in the page about editor modes 2013-08-22 15:17:30 +00:00
hallgren
9efb9ce2fb gfse: don't use multiline text boxes everywhere, just for concrete syntax 2013-08-21 14:19:05 +00:00
kr.angelov
8f58dcdf63 change the locale in the test script for the Python binding 2013-08-21 13:17:39 +00:00
kr.angelov
fa32a6290e fix in the C parser 2013-08-21 13:09:21 +00:00
ramona.enache
9f1a2e5b67 added Facebook grammar from SummerSchool tutorial on best practices for grammar writing 2013-08-21 13:05:22 +00:00
kr.angelov
1f4b55735e fix a crash in the python binding 2013-08-21 12:47:40 +00:00
hallgren
08766585e6 gf -server: fix for directory URLs without a trailing slash
When a browser requests a URL that refers to a directory, web server usually
redirect the browser to the same URL with a trailing '/' added, if one was not
already present. This is to prevent relative links in the returned document
from being interpreted relative to the parent directory instead of the current
document. This type of redirection was missing in gf -server.
2013-08-20 15:38:26 +00:00
aarne
cbe2cb9908 new Foods for Chi, Gla, Ori 2013-08-20 13:27:16 +00:00
hallgren
4e7be49927 download page: link to Inari's notes on installing GF on windows 2013-08-20 08:09:58 +00:00
kr.angelov
d1368c3519 word completion in the C runtime now returns multi-word expressions and the category for every expression 2013-08-19 15:34:19 +00:00
hallgren
2aa14bfef8 gfse: only try to upload/compile grammars when browser is online
Show error message "Offline" if browser is offline.
2013-08-19 15:00:55 +00:00
hallgren
029f1d40e5 gfse: always open a resizable text box when editing concrete syntax
(Also fixed a broken link in gf-web-api-examples.html)
2013-08-19 14:19:18 +00:00
kr.angelov
e9eeefa6f0 fullFormLexicon in C and Python 2013-08-19 12:16:30 +00:00
kr.angelov
308e1445ca added GuEnum interface for iterating over maps in the C runtime 2013-08-19 12:13:47 +00:00
kr.angelov
87e34b11dc implemented lookupMorpho for C and Python 2013-08-16 15:02:24 +00:00
kr.angelov
662a35bbb3 provide API to access the language code for the concrete language 2013-08-16 12:54:16 +00:00
kr.angelov
1e44fdb3d3 fixes in the C and Python API to make them closer to the Haskell API 2013-08-16 12:44:37 +00:00
kr.angelov
fc7e77bf50 added graphvizParseTree in the C and Python runtimes 2013-08-15 15:10:28 +00:00
kr.angelov
5337b4bef7 graphvizAbstractTree in the C and Python runtimes 2013-08-15 08:06:37 +00:00
john.j.camilleri
bce1dff728 Syntax editor: minor CSS fix 2013-08-13 09:30:13 +00:00
john.j.camilleri
892596d7d6 Correct #chaptwo to #chapfour URLs in tutorial
Thanks to "drbean" from the IRC channel for pointing this out!
2013-08-12 06:55:08 +00:00
hallgren
8a81641b00 doc/gf-developers.t2t: add some notes on how to create .deb and .rpm packages 2013-08-08 12:51:24 +00:00
hallgren
fad63a14be Better error messages for attempts to redefine predefined constants
Instead of just "syntax error", you now get e.g.

   PType is a predefined constant, it can not be redefined

This is a simple change in the parser.
2013-08-07 19:36:09 +00:00
aarne
a05856ec93 finished the refactoring of Fin with unstemmed (for library use) and stemmed (for large-scale parsing use). All differences are located in the file StemFin. 2013-08-07 09:52:40 +00:00
hallgren
824fbee593 Update to version 3.5 in gf.cabal and debian/changelog 2013-08-06 15:42:57 +00:00
hallgren
4dd9a42f4a Move GF 3.5 download page into place. Update home page. 2013-08-06 15:32:20 +00:00
hallgren
2b3854b635 Finalize GF 3.4 download page and release notes 2013-08-06 15:28:53 +00:00
john.j.camilleri
5fd0dbfd7c Add more info about RGL browser to release notes 3.5 2013-08-06 13:32:13 +00:00
hallgren
f0cded5f53 Next release will be GF 3.5, release notes moved to download/release-3.5.t2t.
Some more work on the 3.5 release notes and download page.
2013-08-05 12:38:38 +00:00
hallgren
3be7ab3f49 Update shell reference manual 2013-08-05 11:47:17 +00:00
kr.angelov
8dc7d6c094 added untested port of GNU lightning to ARM 2013-08-01 12:07:06 +00:00
kr.angelov
bf04d9fce7 a bit more on the Java to C binding. Now it is possible to load a grammar and query for the list of languages 2013-08-01 10:48:19 +00:00
kr.angelov
102994144b add two more bullets about the Python and the Java bindings 2013-07-30 11:54:20 +00:00
kr.angelov
80dbbb88b8 added release notes for the C runtime 2013-07-30 11:51:49 +00:00
kr.angelov
383d829d5a the first approximation for a statistical model consistent with dependent types in the abstract syntax 2013-07-30 07:29:11 +00:00
hallgren
27da46a79d Cloud & PGF service: use Content-Type application/json for JSON output
This is in accordance with RFC 4627. http://tools.ietf.org/html/rfc4627
Use application/javascript for JSONP output.
2013-07-29 16:05:54 +00:00
hallgren
ecfcaa5395 Adding download page and release notes for the next release of GF
The suggested next release is 3.4.8 in early August.
Feel free to add things in download/release-3.4.8.t2t.
2013-07-29 13:26:22 +00:00
hallgren
3b334b5707 minibar: more robust test for availability localStorage
Minibar should now work if localStorage is disabled or unavailable.
(In Firefox, disabling cookies also disables localStorage.)
2013-07-29 11:58:17 +00:00
aarne
03db087e38 pointer to RGL publications as main index news item 2013-07-26 08:45:53 +00:00
hallgren
e07a74df01 Allow cross origin requests to GF cloud & PGF services
By adding a header

	Access-Control-Allow-Origin: *

to the HTTP responses, web browsers are informed that it is OK to call the
services from web pages hosted on other sites.

This is apparently supported in most modern browsers, so it should no longer
be necessary to resort to JSONP.

See https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS
2013-07-25 16:04:43 +00:00
aarne
0087456c7a updated the number of PhD thesis and publications in index.html; started an RGL publications page 2013-07-25 15:24:22 +00:00
john.j.camilleri
99cfb34639 RGL Browser: now includes Syntax Editor tab! 2013-07-25 07:36:34 +00:00
aarne
850e02cb6e hs datatype generation for empty abstract types added 2013-07-24 08:11:16 +00:00
gregoire.detrez
5a6f4c3d52 Script to compute predictability of smart paradigms 2013-07-20 20:24:24 +00:00
kr.angelov
666def3789 bugfix for parsing floating point numbers in the C runtime 2013-07-18 14:29:58 +00:00
hallgren
fe79e8cd25 gf-server.cabal: same changes as in gf.cabal for ghc-7.6 compatibility 2013-07-15 17:07:51 +00:00
kr.angelov
d7e42f00c5 the hash function for pgf.Expr is now really added 2013-07-05 05:35:22 +00:00
kr.angelov
8f2032a07d the parser in the C runtime now checks for duplicated results 2013-07-03 12:30:30 +00:00
kr.angelov
f0c703d42f complete pgf_expr_eq in the C runtime 2013-07-02 20:12:57 +00:00
kr.angelov
2948231e0f hash function for abstract syntax trees 2013-07-02 19:12:53 +00:00
kr.angelov
c0a0859566 C runtime: fix the debug modes in the parser and in the reasoner after the changes in the printer 2013-06-27 11:00:26 +00:00
kr.angelov
478b46be87 typos in the documentation for the Python binding 2013-06-27 10:11:49 +00:00
kr.angelov
155afdf9b7 a complete Python API for reading, printing and manipulation of abstract trees and types. This includes dependent types, high-order abstract syntax and implicit arguments 2013-06-27 09:39:15 +00:00
kr.angelov
f4f76e4638 dummy compute function in the Python binding 2013-06-26 10:36:42 +00:00
kr.angelov
d1410aba22 we no longer maintain an explicit list of functions per category since now it is implicitly kept in the JIT compiled code 2013-06-26 09:35:50 +00:00
kr.angelov
fcd2a2b12a forgot to add reasoner.h 2013-06-26 09:09:54 +00:00
kr.angelov
cf0bc127af forgot to add jit.h 2013-06-26 09:08:47 +00:00
kr.angelov
a2af8e216f an optimization in the jitter for generating more compact code 2013-06-26 09:03:51 +00:00
kr.angelov
3c2d1890d0 patch for adjustable heuristics from Python 2013-06-26 07:36:03 +00:00
kr.angelov
d94b6146f2 compatibility issue for MacOS X 2013-06-26 07:03:32 +00:00
kr.angelov
3a22258109 fix for x86_64 2013-06-26 06:43:33 +00:00
john.j.camilleri
ebc4d2173b GF homepage: Add section for "getting help" (mentioning IRC channel)
and remove "fragments" from Maltese
2013-06-26 06:28:54 +00:00
kr.angelov
d553cb165a Now there is a just-in-time compiler which generates native code for proof search. This is already used by the exhaustive generator. The time to generate 10000 abstract trees with ParseEng went down from 4.43 sec to 0.29 sec. 2013-06-25 19:22:42 +00:00
kr.angelov
09a42bbab0 bugfix for the linearizer in the C runtime 2013-06-24 07:56:42 +00:00
john.j.camilleri
526bfff57d Add news about Maltese RG, IRC channel to homepage 2013-06-24 07:49:30 +00:00
kr.angelov
9058ccb3eb bugfix for the word completion in the C runtime 2013-06-22 15:39:47 +00:00
kr.angelov
fa7ac00838 add x86_64 support to GNU lightning 2013-06-20 08:27:04 +00:00
kr.angelov
f8073ea1cd fíx in the Python binding for compatibility with Python<2.7 2013-06-19 19:31:55 +00:00
kr.angelov
0ad4c9bf65 fix an issue in the Python binding related to the 32 vs 64 bit compatibility 2013-06-19 18:47:52 +00:00
kr.angelov
e65bbb0713 fix for a couple of warnings that are generated when GNU lightning is used 2013-06-17 07:32:41 +00:00
kr.angelov
407f680bae add the source code for GNU lightning in the source directory for the C runtime 2013-06-17 07:26:00 +00:00
virk.shafqat
8abd16bace added Sindhi Phrasebook 2013-06-15 20:12:48 +00:00
virk.shafqat
d1d5543c26 Improvements In Sindhi RG 2013-06-15 20:02:00 +00:00
kr.angelov
b0b4f57775 bugfix in the python binding 2013-06-14 07:02:53 +00:00
hallgren
bdfd663e91 Fix UTF-8 decoding problem in gf -server
The package network-2.4.1.1 thoughlessly introduced a backward incompatible
change to the function Network.URI.unEscapeString, see

    f2168b1f89

This also affects the function Network.Shed.Httpd.queryToArguments, which is
used in GFServer.hs.

To remain compatible with older and newer versions of the network package,
we need to stay clear of queryToArguments and unEscapeString. A replacement
function has been added to server/URLEncoding.hs.
2013-06-13 08:23:48 +00:00
john.j.camilleri
51ece66688 Syntax editor: minor CSS tweak to resemble Minibar more 2013-06-13 07:34:16 +00:00
john.j.camilleri
c505747492 Syntax editor: AST string always shown, remove export button 2013-06-13 07:26:10 +00:00
john
3bf505d375 Update Maltese Foods grammar
In preparation for presentation at Maltese Linguistics conference next week.
2013-06-11 09:05:13 +00:00
john
dafc992b7e Maltese RG: first proper release
Of course some bugs remain and more testing is needed,
but all functions are complete and Maltese now builds as part
of the normal GF install.
2013-06-10 21:37:10 +00:00
hallgren
d010dfdcfa Update the usage text for the --output-format option
It needs to be updated manually when the list of available output format
changes.
2013-06-10 12:00:14 +00:00
hallgren
5b36461c1d GF.Text.Transliterations: avoid error prone function Data.Map.fromAscList 2013-06-02 10:10:46 +00:00
aarne
f33059ae39 Prasad's sanskrit transliteration ; MiniresourceSan now compiles but is mostly incorrect due to missing paradigms 2013-05-31 16:25:42 +00:00
kr.angelov
54a0642bee now the call Expr.unpack("? e1 e2") in Python returns a pair with None as the first element and a the list [e1,e2] as the second. This makes it easier to decompose partial abstract trees 2013-05-31 09:24:15 +00:00
kr.angelov
1ce5fa3663 improved error message in the Python binding 2013-05-31 09:13:16 +00:00
aarne
0ede1365dc started MiniresourceSan ; doesn't compile yet 2013-05-31 08:00:09 +00:00
kr.angelov
aa644169c2 bugfix for the grammar printer in the C runtime 2013-05-30 20:20:02 +00:00
aarne
a5a269ac35 phrasebook Nor compiles again; added make ParseChi and ParseEngChi 2013-05-30 15:08:45 +00:00
aarne
1507881cb4 added VW foundation as sponsor and made the title conformant to funding decision on summer school web page 2013-05-28 14:59:15 +00:00
normundsg
f2ffe8bc7d PhrasebookLav is now compatible with the latest resource grammar 2013-05-30 14:48:21 +00:00
kr.angelov
51ae8bbce1 the Bulgarian phrasebook works again 2013-05-30 13:16:35 +00:00
john.j.camilleri
0893473aac Remove summer school page from darcs
It is now in www/school/2013 and should be edited directly on server
2013-05-30 09:48:00 +00:00
john
12424fe1f2 Summer school page: add link to Google Group 2013-05-30 07:01:18 +00:00
john
261594cc5a Summer school page: udpate with directions from Hans 2013-05-30 06:56:55 +00:00
kr.angelov
739b10f2a8 a simple refactoring in the Python runtime 2013-05-29 11:02:18 +00:00
kr.angelov
43bffd3f7d readPGF in the Python runtime now throws "No such file or directory" exception if the grammar is missing 2013-05-29 10:49:56 +00:00
john.j.camilleri
ef2a875116 Summer School page: minor adjustments 2013-05-29 06:37:23 +00:00
john.j.camilleri
d49d8f56ed Update Summer School page with sponsorship info (Aarne's changes) 2013-05-29 06:29:25 +00:00
kr.angelov
bae05df3b0 added a test class for the Java API plus a small refinement in the implementation for the binding 2013-05-28 13:32:32 +00:00
kr.angelov
3147e16453 an initial skeleton for building a Java binding to the C runtime 2013-05-28 12:59:19 +00:00
hallgren
29f1487aa4 Demo page: add a version of the minibar that shows just the MOLTO Application grammars 2013-05-24 14:20:36 +00:00
kr.angelov
b7cbee7940 fix the encoding problem with unicode literals in the Python binding 2013-05-21 10:53:20 +00:00
aarne
3e30dd78ec annotated Adv's in SentencesI to Syntax.Adv to avoid some clashes 2013-05-20 06:40:40 +00:00
kr.angelov
517b8ff1ee bugfix for bracketedLinearize which was causing crash if the tree cannot be linearized 2013-05-07 08:35:33 +00:00
kr.angelov
687b326ed0 bug fix in the management of memory pools in the statistical parser 2013-05-07 08:30:32 +00:00
kr.angelov
7ba27229b3 the statistical parser is now using two memory pools: one for parsing and one for the output trees. This means that the memory for parsing can be released as soon as the needed abstract trees are retrieved, while the trees themselves are retained in the separate output pool 2013-05-06 15:28:04 +00:00
kr.angelov
520c2fb59d fix the leftcorner filtering after the addition of word completion 2013-05-05 10:30:06 +00:00
kr.angelov
b8d61fcbb2 bugfix in the C runtime which was causing an infinite loop while linearizing partial trees 2013-05-04 13:32:57 +00:00
hallgren
da577d15ef Download page: the .deb packages also work on Ubuntu 13.04 2013-05-03 13:14:27 +00:00
gregoire.detrez
08a67b9f34 [haskell runtime] Remove trailing whitespaces in VisualizeTree.hs 2013-05-03 09:42:29 +00:00
hallgren
e44580aced Setup.hs: comment out ineffective parallelisation 2013-05-02 12:36:16 +00:00
kr.angelov
22f44ef61f word completion in the C runtime. The runtime/python/test.py example is now using readline with word completion 2013-05-01 06:09:55 +00:00
hallgren
41bccf5737 Download page & developers guide: add a section about known problems with Cabal 2013-04-29 13:12:37 +00:00
aarne
4f831291b1 miniresource functor 2013-04-28 09:42:56 +00:00
kr.angelov
85efdf81e7 finally the statistical parser is able to return all possible abstract trees 2013-04-26 20:44:01 +00:00
hallgren
8d866541d3 gfse: use alltenses/ instead of present/ when looking up RGL oper types 2013-04-26 15:01:11 +00:00
hallgren
b88065e250 Add greek to Setup.hs and the web apps 2013-04-26 13:42:01 +00:00
hallgren
c841c2c3c9 minibar: remove two more uses of with() 2013-04-25 15:08:26 +00:00
hallgren
7fe4ff8c46 minibar: fix bug that prevented minibar from working in Webkit browsers
The with(...) {...} statement has different scoping rules in Webkit browsers
and Gecko browsers, so it is better to avoid it.
2013-04-25 14:55:24 +00:00
aarne
6d6c565f98 Greek by Ioanna Papodopoulou - complete, 27th RGL language 2013-04-25 13:22:28 +00:00
hallgren
5fe680c837 PGF service: apply the token binding operator &+ to all linearizations
The &+ operator is now consistently eliminated from the output of commmands
that produce linearizations. Before, only the commands translate and
translategroup did this.
2013-04-24 18:32:53 +00:00
hallgren
7f0f91a54b js/localstorage.js: don't throw an exception if JSON parsing fails
Return the given default value instead.
2013-04-23 14:14:38 +00:00
hallgren
1146b94685 gfse: add access to the syntax editor
via the minibar
2013-04-23 13:55:00 +00:00
hallgren
2639dc67b1 js/gfrobust.js: don't try to translate sentenses that are too long
The C run-time responds badly to input that is too long, so we return an
error message here instead.
The limit is 200 URL-encoded characters.
2013-04-23 13:40:38 +00:00
hallgren
ba1bdaa3dc js/localstorage.js: improved faked localStorage if real localStorage is missing 2013-04-23 12:44:12 +00:00
hallgren
bcf8346716 minibar: use the common interface to localStorage
...for more streamlined code and better browser compatibility.
2013-04-23 12:39:18 +00:00
kr.angelov
aad274022a a trivial refactoring of the reasoner in the C runtime 2013-04-23 06:40:14 +00:00
aarne
67f33e5f24 new-gf-bib fixes 2013-04-22 20:48:50 +00:00
inari.listenmaa
20afaf9fbc new source to new-gf.bib
in addition to the previous ones, added also a source that isn't related to GF, but is used as a source in the sublanguage paper.
2013-04-22 17:22:11 +00:00
inari.listenmaa
e7f1bea55e new sources to new-gf.bib
Including sources needed in MTsummit paper about sublanguage. MOLTO deliverables and some conference papers.
2013-04-22 17:19:29 +00:00
kr.angelov
6481f448fc bug fix in pgf-translate which was hiding that there are more than one trees per sentence 2013-04-22 13:02:43 +00:00
kr.angelov
4394b8a3bc a bit more informative error message in GrammarToPGF 2013-04-22 12:14:39 +00:00
kr.angelov
b1b68bf6b4 reverse the direction of the arcs in the dependency trees 2013-04-21 19:20:08 +00:00
virk.shafqat
3e453b44be refinementsDiffHindustani 2013-04-20 09:15:49 +00:00
hallgren
a0bcea3076 gfse: don't add --# -path=.:present
Nowadays GF includes alltenses by default in the grammar search path.
2013-04-20 07:25:38 +00:00
hallgren
4ca26b8734 simple translation tool: minor documentation fix 2013-04-19 14:10:03 +00:00
hallgren
8f187584e9 gf-cloud-api.html: fixed a typo
in the documentation of command=remake.
2013-04-19 12:17:27 +00:00
hallgren
27545f6d18 gf-cloud-api.html: clarification
Unrecoginzed parameter in cloud service requests are silently ignored.
2013-04-19 12:06:00 +00:00
kr.angelov
09c1bd662d the option -old for the vp command is now redundant 2013-04-19 11:15:18 +00:00
kr.angelov
4e2044ab99 remove the dead code left behind by Peter Ljunglöf in VisualizeTree 2013-04-19 11:13:07 +00:00
kr.angelov
a591160b94 fix the command options for the vd command in the shell 2013-04-19 11:11:57 +00:00
kr.angelov
542dcaa0ec the C runtime and the Python binding now have an API for parser evaluation. The API computes PARSEVAL and Exact Match for a given tree. As a side effect the abstract trees in Python are now compared for equality by value and not by reference 2013-04-19 10:57:46 +00:00
kr.angelov
f050609101 added API for computing bracketed strings from Python and C 2013-04-18 13:37:09 +00:00
hallgren
ff691dee7b simple translator: improved translation with the GF robust parser
by separate punctuation from the string sent to the robust parser.
Also added buttons to view parse trees from the robust parser.
2013-04-18 13:11:46 +00:00
hallgren
5f35a59b95 gfrobust.js: add a method for constructing parse tree image URLs. 2013-04-18 13:11:05 +00:00
hallgren
6ae28fc693 GF home page: add "machine translation" in a meta keywords tag
GF does not show up if you google for machine translation. This meta tag might
help, but in general I think it is better for SEO to mention relevant keyword
in the body text than to rely on meta tags.
2013-04-18 12:02:32 +00:00
hallgren
563299085d minibar: syntax editor integration bug fix
The minibar has the alternative "All" in the target language menu. This should
not be included when transfering to the syntax editor.
2013-04-17 08:49:31 +00:00
hallgren
b037fa2b32 minibar: fixes for phrasebook
Add minibar option to_multiple to be able to turn off selection of multiple
target languages.
2013-04-17 08:39:39 +00:00
kr.angelov
b49b9d459a added a malt_tab format to the vd command in the GF shell 2013-04-16 18:22:37 +00:00
kr.angelov
f6d675c34b the generation of dependency trees in the Haskell runtime is now finally working with bracketed strings. This also fixes some errors in the old implementation 2013-04-16 13:10:48 +00:00
kr.angelov
2f35964871 the compiler now sorts the list of functions per category in probability order. this ensures probability order search in the C runtime 2013-04-15 19:58:57 +00:00
john
b9f530a805 Update summer school page 2013-04-13 13:21:03 +00:00
hallgren
d35790e656 GF cloud: work on syntax editor integration
+ The syntax editor is now accessible from the Simple Translaton Tool.
+ The minibar now automatically provides access to the syntax editor (provided
  the necessary JavaScript files and style sheets have been loaded).
+ Preparations for making the syntax editor accessible from the grammar editor.
2013-04-12 18:29:15 +00:00
hallgren
1d0f9372f4 syntax editor: fix references to global object 'server' 2013-04-12 17:50:44 +00:00
hallgren
eb941d6eac minibar/syntax editor integration fixes
When starting from the minibar, the selected set of target languages is now
preserved when switching back and forth.
2013-04-12 14:30:27 +00:00
hallgren
a0d785610d Simple Translation Tool: eliminate &+ in translations from GF
Also fixed a bug introduced in previous refactoring.
2013-04-12 13:00:05 +00:00
hallgren
40e9fe30c3 gfrobust.js: adding a JavaScript API to the GF Robust Parser translation service
Factored out from the Simple Translation Tool.
2013-04-12 12:47:13 +00:00
hallgren
59f9f9dd17 minibar.html: add debug element
to allow debug output from the syntax editor when it is started from the
minibar.
Also fix broken markup.
2013-04-11 11:47:06 +00:00
hallgren
5bce1d7a16 gf -s/-q now silences "no linearization of" warnings 2013-04-10 23:00:01 +00:00
hallgren
b8ce5ef5b3 PGF.hs: export function missingLins
Also in Commands.hs: be explicit about things imported from the PGF library
that are not in the public API.
Also a couple of haddock documentation fixes.
2013-04-08 15:38:11 +00:00
hallgren
35b47968d2 minibar: add a visual hint that linearizations can be expanded into tables 2013-04-07 12:06:12 +00:00
hallgren
cc0743ade1 Compiler.hs: ghc 7.6.2 compatibility 2013-04-05 20:37:37 +00:00
hallgren
5a7e8cc601 Simple Translator: add GF Robust Parser to the menu for individual segments 2013-04-05 20:32:20 +00:00
hallgren
0bbbda0911 Simple Translator: use lextext/unlextext for translations with the robust parser 2013-04-05 15:15:40 +00:00
hallgren
fca0a00c81 Simple Translator: initial support for translation with the GF robust parser 2013-04-05 13:25:09 +00:00
kr.angelov
1f91928606 now the web service to the robust parser can to translations also 2013-04-05 12:22:52 +00:00
kr.angelov
9e741cfe30 a bugfix which was causing an infinite loop in the C linearizer for some sentences 2013-04-05 09:11:24 +00:00
kr.angelov
a449a240de a very simple linearization for partial abstract trees in the C runtime 2013-04-05 08:42:56 +00:00
hallgren
3c244ff27f minibar/syntax editor integration improvements
Work in progress on preserving the start category and selected target languages
when switching between the minibar and the syntax editor.
2013-04-04 14:04:31 +00:00
hallgren
a22a419bc7 Simple Translation Tool: initial support for editing source segments in the minibar 2013-04-03 20:24:57 +00:00
hallgren
0568a1a32a Adding src/www/js/localstorage.js
A common interface to localStorage, to store JSON data under a unique prefix.
2013-04-03 20:23:32 +00:00
hallgren
c02d5b188b Prevent Unicode characters in warning messages from stopping grammar compilation
When compiling a grammar containing characters that are not supported in the
current locale, warning messages could cause GF fail with 

  hPutChar: invalid argument (Invalid or incomplete multibyte or wide character)

With this quick fix, warning messages that can not be displayed are silently
truncated instead, and compilation continues.
2013-04-03 06:42:08 +00:00
john.j.camilleri
458ffc42d1 Replace "CId" with "Language" in type signature for PGF.tabularLinearizes 2013-04-02 09:19:08 +00:00
hallgren
078edf3e6b gf.cabal: fix tab char problem 2013-04-02 14:53:15 +00:00
hallgren
eb3fc960d5 gf.cabal: gf depends on utf8-string even when compiled without server support 2013-04-02 14:50:01 +00:00
hallgren
f26778feb0 minibar: remember the selected set of target langauges 2013-04-02 13:49:50 +00:00
hallgren
4e40fd5697 minibar: abstract syntax trees are now shown with or without category names
Function names are always shown.
2013-04-02 11:56:10 +00:00
aarne
e56bfe8811 option pt -funs to show all fun's in a tree 2013-03-29 11:45:42 +00:00
hallgren
63c0b7ae5d minibar: show abstract syntax trees without or with function names
Click once to show abstract syntax trees without function names. Click again
to add function names.
2013-03-28 16:00:04 +00:00
hallgren
08046137cb PGF web API: command=abstrtree not supports the nocat and nofun options 2013-03-28 15:57:17 +00:00
kr.angelov
74a16273b9 added simple script for estimating the coverage on the PennTreebank 2013-03-28 09:15:38 +00:00
kr.angelov
17fc938c20 added a few more multiword expressions in DictEng and a few words in the abstract syntax are not tagged with their senses. There is a new statistical model too 2013-03-27 20:46:42 +00:00
hallgren
be1d380ea5 minibar: fix problems with the To: menu
Automatically expanding the menu when the mouse is over it seems to cause wierd
scrolling behavior in Chrome (and also in Firefox but less severe).
2013-03-27 23:39:35 +00:00
hallgren
323982b0ea minibar: documentation update 2013-03-27 16:45:09 +00:00
hallgren
8b06936c01 minibar: click on a linearization to obtain a table with all variants and forms
Click again to hide the table.
2013-03-27 16:35:56 +00:00
hallgren
7e214fee01 support.js: add function replaceNode 2013-03-27 16:35:32 +00:00
hallgren
1ff78dae97 PGF web API: add comand linearizeTable
The new command linearizeTable outputs linearizations as tables containing all
variants and forms, labelled by parameters
2013-03-27 16:31:52 +00:00
hallgren
060e3147e8 minibar: fix buttons for abstract syntax trees and word alignment diagrams
They stopped working after yesterday's changes.
2013-03-27 14:07:16 +00:00
inari.listenmaa
8c8c63b2e9 Copula and lexical corrections to PhrasebookCat 2013-03-26 16:47:36 +00:00
hallgren
2cb7ed5734 minibar: documentation update 2013-03-26 14:38:10 +00:00
hallgren
155c559e5f minibar: show parse trees without or with function names
Click once to show the parse tree without function names. Click again to
add function names.
2013-03-26 14:24:22 +00:00
hallgren
1962574941 PGF service: support all parse tree visualziation options in the web API
The new options are

  * noleaves, nofun, nocat (booleans, false by default)
  * nodefont, leaffont, nodecolor, leafcolor, nodeedgestyle, leafedgestyle
    (strings, empty by default)
2013-03-26 14:17:24 +00:00
hallgren
9faa3407ab haddock bug workaround 2013-03-26 13:14:37 +00:00
hallgren
dca51e7417 minibar: initial support for selecting an arbitrary subset of target languages
This affects which translations are shown and which languages are included in
the word alignment diagrams.
2013-03-25 17:43:12 +00:00
hallgren
3ae3df209e Setup.hs: paralell RGL module compilation experiment
For this to have any effect, Setup.hs has to be compiled with -threaded, which
cabal-install doesn't do, unfortunately...
2013-03-25 14:03:10 +00:00
kr.angelov
885a14e64d added the file treebanks/PennTreebank/ParseEngAbs3.probs which is used by the statistical parser for robust chunking 2013-03-25 10:28:53 +00:00
kr.angelov
40fb775a79 a long list of prepositions from Wikipedia is now imported in DictEng in addition there are a number of small other changes in the dictionary. The statistical model is updated and is now moved to treebanks/PennTreebank/ParseEngAbs.probs 2013-03-25 10:24:24 +00:00
kr.angelov
d1866472eb added configuration file which defines the heads for all syntactic functions in ParseEng 2013-03-21 13:39:24 +00:00
kr.angelov
c6e4db8f4a the calculation of lexical_prob in the statistical parser doesn't work properly. It should be fixed but for now I just disabled the optimization 2013-03-20 12:28:52 +00:00
kr.angelov
2aacbb0c46 replace #if with #ifdef when checking for the optional bottom up filtering in the C runtime 2013-03-20 10:47:47 +00:00
kr.angelov
770b1af6d9 the bottom up filtering in the C runtime is temporary disabled. It takes too much memory and even makes it impossible to load the Finnish and the German parsing grammars. 2013-03-19 10:59:44 +00:00
hallgren
80fe693546 Fix a problem with pattern macros in pre { } expressions
The old partial evaluator has special rules to convert pattern macros in
pre { } expressions. These rules were missing in the new partial evaluator.
2013-03-16 13:36:23 +00:00
kr.angelov
411d91d410 bug fix in the linearizer in the C runtime 2013-03-14 12:31:49 +00:00
kr.angelov
d018502fca update the pgf-service tool from the C runtime after the changes in the API 2013-03-14 10:37:01 +00:00
hallgren
66dae1fe17 Update shell reference manual 2013-03-14 08:08:51 +00:00
hallgren
07f958a9b7 PGF web API: add 'to' parameter to the 'alignment' command
Word alignment diagrams can now be restricted to a subset of the languages
supported by the grammar.
2013-03-13 15:56:03 +00:00
hallgren
d4fc60f260 PGF web API: generalize the 'to' parameter to accept a list of languages
Some commands (linearize, linearizeAll, random, generate, translate and
translategroup) by default produce output in all languages supported by the
grammar and the 'to' parameter could be used to restrict output to a single
language. Now you can restrict the output to a list of languages. Languages
should be separated by spaces.

Also removed an unnecessary LANGUAGE pragma and reduced code verbosity.
2013-03-13 15:25:28 +00:00
aarne
7d1040ffb9 pt -nub to remove duplicate trees from a list returned e.g. by a parser 2013-03-13 13:43:30 +00:00
hallgren
e5ce4d4b1e partial evaluator: push predefined functions inside variants
This should prevent errors like

Internal error in Compute.ConcreteNew:
    Applying Predef.drop: Expected a value of type String, got VFV [VString "gewandt",VString "gewendet"]
2013-03-12 16:36:58 +00:00
aarne
78b3487cb7 command pt -subtrees that analyses a tree into the set of subtrees. Using pt -subtrees <bigtree> | l -treebank for debugging the lin of a big tree 2013-03-12 14:58:06 +00:00
kr.angelov
ca3716857c bugfix in the statistical parser 2013-03-11 14:47:43 +00:00
hallgren
d1c5fafc69 Additional changes for GHC 7.4 & 7.6 compatibility 2013-03-11 12:57:09 +00:00
Sergei Trofimovich
0173b5f4ff ghc-7.6: allow directory-1.2
Get rid of old-time depend (and ClockTime in favour of UTCTime).
time-compat helps to retain backward compatibility with directory-1.1
and lower.
2013-03-09 21:38:43 +00:00
Sergei Trofimovich
576b19aab5 ghc-7.6: fix src/server/PGFService.hs (use catch from base-4 Control.Exception) 2013-03-09 21:38:14 +00:00
Sergei Trofimovich
5b688b6359 ghc-7.6: add missing Num instance for Bits
Fixes the following build failure:
    src/runtime/haskell/Data/Binary/IEEE754.lhs:256:17:
        Could not deduce (Num a) arising from a use of `mask'
        from the context (Bits a)
          bound by the type signature for
                     clamp :: Bits a => BitCount -> a -> a
2013-03-09 21:19:53 +00:00
Sergei Trofimovich
523633a092 Setup.hs: switch to base-4 exceptions
Fixes build failure on ghc-7.6:
    $ runhaskell Setup.hs configure
    Setup.hs:394:14: Not in scope: `E.try'

base-4 is available/default since ghc-6.10.
2013-03-09 21:18:03 +00:00
inari.listenmaa
921951a5e2 Small corrections in Spa files
* WordsSpa: Married with state copula; Warm from "tibio" to "caliente"; corrected a typo in Romania
2013-03-08 12:33:21 +00:00
hallgren
8200145513 Fix a bug that could cause "Prelude.head: empty list"
In Data.Operations, the function topoTest2 assumed too much about the form of
the input, compared to the older function topoTest.
2013-02-28 17:46:13 +00:00
hallgren
95d77e3c37 pattern match length estimation code simplication 2013-02-28 15:13:20 +00:00
hallgren
0feb386691 Faster regular expression pattern matching in the grammar compiler.
The sequence operator (x+y) was implemented by splitting the string to be
matched at all positions and trying to match the parts against the two
subpatterns. To reduce the number of splits, we now estimate the minimum and
maximum length of the string that the subpatterns could match. For common
cases, where one of the subpatterns is a string of known length, like
in (x+"y") or (x + ("a"|"o"|"u"|"e")+"y"), only one split will be tried.
2013-02-27 20:59:43 +00:00
hallgren
95c4cbb8f5 GF grammar pretty printer improvements
Allow line breaks in more places to make large terms more readable.
2013-02-27 14:22:47 +00:00
kr.angelov
026c198974 added gu_buf_flush in seq.c which removes all elements from a buffer 2013-02-26 09:48:09 +00:00
john.j.camilleri
30db411075 GFEP: update readme 2013-02-22 15:33:52 +00:00
aarne
88d7adfa85 fixed details of Romance clitics for reflexives, imperatives, infinitives. A change in the type of VP.clit3 was needed. 2013-02-20 19:34:20 +00:00
kr.angelov
9cb0b580d3 the parser in the C runtime should not crash if the start category is not defined 2013-02-19 12:08:48 +00:00
kr.angelov
13de2fafb4 bugfix in the grammar reader in the C runtime 2013-02-19 12:04:10 +00:00
kr.angelov
9940fe392e bugfix in the linearizer for the C runtime 2013-02-13 15:39:01 +00:00
hallgren
4f243fbf12 Fix for a PGF portability problem
GF produced slightly different PGF files on 64-bit systems and 32-bit systems.
This could cause problems when a PGF was produced on a 32-bit system and used
on a 64-bit system.

To fix this, the GF compiler and the Haskell PGF run-time library now reads
and writes PGF files like the 32-bit version even when compiled on a 64-bit
system.

Note: the Haskell type Int is still used internally in GF, which could be
32 bits or 64 bits...
2013-02-13 14:28:06 +00:00
kr.angelov
4922ab6cc4 now the beam size for the statistical parser can be configured by using the flag beam_size in the top-level concrete module 2013-02-12 10:53:13 +00:00
kr.angelov
a4c9d20fc3 the statistical parser now uses a baseline lexical estimation of the beam size 2013-02-12 09:41:32 +00:00
hallgren
e5231eebbd translator: add some menu padding for touch devices 2013-02-11 16:46:43 +00:00
hallgren
ae16e48d0d translator: small style change 2013-02-11 16:33:48 +00:00
hallgren
4ee6a83369 translator: remove debug code 2013-02-11 16:13:39 +00:00
hallgren
0a8ccfe912 translator: "Open..." doesn't discard the current document anymore
It shows available documents and a Cancel button on top of the current
document.
2013-02-11 16:03:17 +00:00
hallgren
234572b556 gf.cabal: version 3.4-darcs 2013-02-11 16:02:50 +00:00
kr.angelov
6a36ce77ff the class PgfConcr from the Python binding now has a property name which returns the name of the concrete syntax 2013-02-11 15:51:26 +00:00
kr.angelov
d124fa9a12 refactoring: now all named objects in the C runtime have an explicit name field 2013-02-11 14:10:54 +00:00
kr.angelov
90c3304147 remove the pgf2yaml tool which was both broken and redundant. The declarations for generic programming from data.c are removed as well 2013-02-11 13:51:12 +00:00
kr.angelov
10ef298fa0 the grammar reader in the C runtime is completely rewritten and it doesn't use the generic programming API 2013-02-11 10:16:58 +00:00
hallgren
88d20ca612 GF home page style update 2013-02-07 13:11:09 +00:00
aarne
f9a32dca3b pg -lexc now writes a list of multichar symbols and a title ("Root") for the lexicon, as required by Xerox lexc 2013-02-03 10:03:15 +00:00
kr.angelov
5e2474e346 This patch removes Gregoire's parse_tokens function in the python binding and adds another implementation which builds on the existing API for lexers in the C runtime. Now it is possible to write incremental Lexers in Python 2013-02-01 09:29:43 +00:00
kr.angelov
c99ab058ea implement gu_exn_caught in gu/exn.c. It was missing 2013-02-01 09:26:30 +00:00
kr.angelov
eda1058441 fix the Windows link 2013-01-31 15:06:42 +00:00
kr.angelov
e2d0ab8c62 added a link to the Windows binary from the download page 2013-01-31 15:03:35 +00:00
hallgren
74c5bdbafc download page: add link to Fedora RPMs, mention GitHub 2013-01-31 13:03:37 +00:00
hallgren
1393f0519f GF 3.4 download page: add binary packages for Mac OS X and Ubuntu 2013-01-31 00:49:13 +00:00
hallgren
c57fcca3d1 Update download page to GF 3.4 2013-01-30 23:34:50 +00:00
hallgren
38fbd142a0 This is GF 3.4! 2013-01-30 23:27:06 +00:00
hallgren
9c63cb9e2c debian/changelog: updated for GF 3.4 2013-01-30 17:20:46 +00:00
aarne
374441ad8c updated resource synopsis and the scripts creating it; added Swahili to main index list 2013-01-30 17:01:22 +00:00
aarne
e20a62366f commented out some old history from index.html, and completed the list of languages 2013-01-30 16:54:51 +00:00
hallgren
6c7948fa24 download/index-3.4.t2t: download page for GF 3.4
Will be renamed to index.t2t when the release is official.
2013-01-30 16:44:16 +00:00
hallgren
d149dd8a58 doc/gf-developers.t2t: updated 2013-01-30 16:32:44 +00:00
hallgren
3cd71e7c0d gf.cabal: Tested-with GHC==7.4.2 only, older versions cause minor problems 2013-01-30 15:57:35 +00:00
hallgren
f0de776045 Setup.hs: eliminate "minimal" mode, fix darcs version info
The reported number of recorded changes since the last tagged version was off
by one (because it counted the change that set the tag).
Also added a note that -K32M is not needed when using new-comp. But -old-comp
is still available as a configuration option, so I'm keeping -K32M for now.
2013-01-30 15:48:36 +00:00
hallgren
3ebf878281 release-3.4.t2t updates
Don't include names of contributors, link to additional info instead.
2013-01-30 15:08:26 +00:00
hallgren
602cbc953c Add note about RGL Browser to 3.4 release notes
Also fixed a smalll typo
2013-01-29 20:51:42 +00:00
aarne
c3430f3e24 more on RGL languages in release notes 2013-01-29 17:50:27 +00:00
aarne
f2650007c7 updated the lists of notPresent languages 2013-01-29 16:53:15 +00:00
hallgren
d4b6d1b6fe Better error message for unsupported token gluing
Instead of "Internal error in ...", you now get a proper error message with
a source location and a function name.
2013-01-29 16:25:03 +00:00
hallgren
14c8da214c Fix a bug with record extension
Add a conversion rule for ({ l1 = e } ** x).l2 in PMCFG generation. (A rule
for the symmetric case (x ** { l1 = e }).l2 was added some time ago.)
2013-01-29 14:59:16 +00:00
hallgren
211cd9bb25 Avoid crash in random generation with probabilities 2013-01-29 13:59:20 +00:00
kr.angelov
84fa796de4 bugfix in the reference counting for Python 2013-01-29 09:41:12 +00:00
kr.angelov
05cb74d14a the Python binding is in pure C again 2013-01-29 09:20:32 +00:00
kr.angelov
b524c5d8b5 added an API for composing and decomposing abstract trees from Python 2013-01-29 09:07:41 +00:00
kr.angelov
8846648393 fixed typos in the python binding: in a few places pgf_ExprType was used instead of pgf_ExprIterType 2013-01-29 09:06:23 +00:00
aarne
e1a92efd76 added Heb = Hebrew to the incomplete languages that can be compiled 2013-01-28 18:03:35 +00:00
hallgren
a559e51608 Quick fix to render some parser error messages from UTF-8-encoded source files correctly.
The parser works on raw byte sequences read from source files. If parsing
succeeds the raw byte sequences are converted to proper Unicode characters 
in a later phase. But the parser calls the function buildAnyTree, which can 
fail and generate error messages containing source code fragments, which might
then containing raw byte sequences. To render these error messages correctly, 
they need to be converted in accordance with the coding flag in the source 
file. This is now done for UTF-8-encoded source files, but should ideally also
be done for other character encodings. (Latin-1-encoded files never suffered 
from this problem, since raw bytes are proper Unicode characters in this case.)
2013-01-28 17:23:02 +00:00
hallgren
713e883ad7 Better error message for Predef.error
+ Instead of "Internal error in ...", you now get a proper error message with
  a source location and a function name.
+ Also added some missing error value propagation in the partial evaluator.
+ Also some other minor cleanup and error handling fixes.
2013-01-28 16:12:56 +00:00
hallgren
3360cc904c Setup.hs: add some incomplete languages to the list compiled languages
To be specific: Amh, Ara, Lat, Tur and Mlt.
2013-01-28 16:07:44 +00:00
aarne
1eb45d955b improved error message for overloading in case the given signature looks the same as one of the expected ones: it shows full records rather than just lock fields. 2013-01-28 14:00:23 +00:00
aarne
899d03d05b some additions to new-gf-bib.bib 2013-01-28 08:42:00 +00:00
gregoire.detrez
0aae4702ed Python binding: add a parsing function that accepts directly a list of tokens.
Is allows to define a tokenizer in python (or use an existing one, from nltk for instance.)
2013-01-24 13:31:34 +00:00
aarne
e7db50b9bd fixed the construction for English indirect questions of name in Phrasebook 2013-01-23 09:29:39 +00:00
john.j.camilleri
3d5d424fef Add fun/cat printnames to PGF web service
This is accessible vis the `browse` command, by adding the flag `printnames`
e.g.: .../Letter.pgf?command=browse&id=Recipient&format=json&printnames=1
2013-01-18 09:39:50 +00:00
hallgren
35aedadc83 gf -server: fix bug in bug fix for current directory 2013-01-13 12:36:58 +00:00
hallgren
68c04cdd63 gf -server: small logging improvements 2013-01-12 18:48:23 +00:00
hallgren
b0228af26d gf -server: defend against problems with the current directory caused unhandled errors 2013-01-12 17:11:31 +00:00
hallgren
4f4c4e4107 GF 3.4 release notes update 2013-01-11 15:43:32 +00:00
john.j.camilleri
b8e3fe7bc0 Syntax editor: initial support for string literals
Also a bug fix when switching to editor, although this still messes up
when using the letters grammar.
Also updated readme with options, and some style improvements.
2013-01-11 15:33:17 +00:00
john.j.camilleri
be5a313372 Syntax editor: add tooltips to buttons 2013-01-11 12:45:24 +00:00
john.j.camilleri
b5e8d06fba Syntax editor: remove beta label 2013-01-11 11:38:45 +00:00
hallgren
a8f281491c partial evaluator: fix token glueing bug
"a"+("b"++"c") was simplified to "bb"++"c" instead of "ab"++c.
2013-01-11 15:14:42 +00:00
john.j.camilleri
28020fdf80 GFEP: update readme for 1.5.2 release 2013-01-11 10:18:13 +00:00
john.j.camilleri
625430fa9c GFEP: remove doc makefile, updated index.html 2013-01-10 16:19:27 +00:00
john.j.camilleri
fb644d57b7 GFEP: remove doc images and include redirection file (.htaccess) 2013-01-10 10:41:01 +00:00
hallgren
f2751ff9e1 Fixes for minibar offline
Tested it in Firefox 18 (which has the new Ionmonkey JavaScript engine).
Still get stack overflows.
2013-01-09 16:44:18 +00:00
hallgren
1497fd863a PGF service: new command: download
This makes it possible to download PGF files from servers where the PGF service
is installed.

I am also considering making commmand=download the default instead of
command=grammar.
2013-01-09 13:28:45 +00:00
kr.angelov
580e443a5e fix warnings in pgf-parse.c 2013-01-08 12:53:49 +00:00
peter.ljunglof
f74155ef6a PGF installation instructions for Mac OSX 2013-01-08 10:23:25 +00:00
peter.ljunglof
49022f5849 Made meta probs an optional argument instead of hard-coded in pgf-translate 2013-01-08 10:20:46 +00:00
peter.ljunglof
599b51830f New PGF utility: pgf-parse 2013-01-08 10:19:53 +00:00
kr.angelov
9b78da5357 now the Python binding has an alternative representation for abstract trees which is composed of Python objects. The new representation is not integrated with the core runtime yet 2013-01-07 15:11:12 +00:00
kr.angelov
2c169406fc a new reasoner in the C runtime. It supports tabling which makes it decideable for propositional logic. dependent types and high-order types are not supported yet. The generation is still in decreasing probability order 2013-01-07 12:50:32 +00:00
kr.angelov
cade578d04 bugfix in the strings library from the C runtime 2012-12-27 21:18:46 +00:00
Nikita Frolov
67380fa398 RG and Phrasebook fixes
- added a paradigm for alternative plurals
- fixed usage of alternative plurals in Numerals
- added a distinction between numerals and posessive pronouns
- verb omission and appropriate cases in some uses of to be/to have 
- fixed declination of personal names
- added a gender parameter to pronouns (similar to Polish RG)
- vowel insertion before short adjective suffix
- don't generate short forms for relative adjectives (might need lexicon update)
- minor Phrasebook fixes
2012-12-27 21:04:26 +00:00
aarne
4eef06e38e started GF FAQ; not yet publishable 2012-12-28 10:57:46 +00:00
hallgren
12dec2503d bug fix in the new partial evaluator
It can leave wildcard tables in their origial form, but it easy to handle
them in the unfactor function in GeneratePMCFG.
2012-12-20 16:41:43 +00:00
aarne
5ff33f47be added alltenses to the default search path (just like prelude) 2012-12-20 16:05:34 +00:00
hallgren
d968503d90 PGFService.hs: code duplication reduction 2012-12-20 00:15:18 +00:00
hallgren
ece3e33c52 partial evaluator bug fix
It failed to delay table selection when the selector contains a run-time
variable, causing "gf: Prelude.(!!): index too large" instead.

Also:
  + Show better source locations on unexpected errors, to aid bug hunting.
  + Removed unused SourceGrammar argument to value2term.
2012-12-19 23:12:37 +00:00
hallgren
b4207d1b00 GF.Grammar.Lookup: new function lookupResDefLoc
It's like lookupResDef but it includes a source location in the output.
2012-12-19 23:08:56 +00:00
kr.angelov
75696808a7 bugfix: the linearizer should not generate extra space at the end of the sentence 2012-12-19 11:18:34 +00:00
kr.angelov
87360ccc34 bugfix for linearization of metavariables at the root of a tree 2012-12-19 10:03:05 +00:00
kr.angelov
a28ccc965c rename linearize.{h/c} to linearizer.{h/c} which follows the convention used in parser.c and reasoner.c 2012-12-19 09:17:24 +00:00
kr.angelov
490a3f2286 a major reimplementation of the linearizer in the C runtime 2012-12-19 09:07:05 +00:00
kr.angelov
ff49d21d13 fixed accidental bug in pgf-parse.c 2012-12-18 15:42:04 +00:00
hallgren
c3beefba47 partial evaluator bug fix
Int was missing from the list of predefined canonical constants.
2012-12-18 13:03:20 +00:00
kr.angelov
403420be2b the C runtime now can read abstract expressions with literals and meta variables 2012-12-18 12:29:30 +00:00
normundsg
cf0d94c1b0 Some fixes to the Russian Phrasebook 2012-12-17 09:57:13 +00:00
kr.angelov
d12c604f9a debugging infrastructure in the reasoner 2012-12-14 21:25:00 +00:00
kr.angelov
16a2c38f38 bugfix for the reasoner in the C runtime 2012-12-14 21:24:17 +00:00
kr.angelov
8ec7ecacca a bit more flexible API for parsing in Python 2012-12-14 16:00:52 +00:00
kr.angelov
20aaa4a989 The first prototype for exhaustive generation in the C runtime. The trees are always listed in decreasing probability order. There is also an API for generation from Python 2012-12-14 15:32:49 +00:00
hallgren
9ab3a6034d Add language extension for ghc<7.4
FlexibleInstances does not imply TypeSynonymInstances, apparently.
2012-12-14 14:21:46 +00:00
hallgren
d7e3c869c2 More work on the new partial evaluator
The work done by the partial evaluator is now divied in two stages:
 - A static "term traversal" stage that happens only once per term and uses
   only statically known information. In particular, the values of lambda bound
   variables are unknown during this stage. Some tables are transformed to
   reduce the cost of pattern matching.
 - A dynamic "function application" stage, where function bodies can be
   evaluated repeatedly with different arguments, without the term traversal
   overhead and without recomputing statically known information.

Also the treatment of predefined functions has been reworked to take advantage
of the staging and better handle partial applications.
2012-12-14 14:00:21 +00:00
kr.angelov
f7a5eb0df1 bugfix in the lexer from the C runtime. the input sentence doesn't have to terminate with whitespace 2012-12-13 16:45:44 +00:00
kr.angelov
0f0b7158c9 added simple error handling in the Python test 2012-12-13 16:44:39 +00:00
kr.angelov
75c544027b added a simple test for the Python binding 2012-12-13 16:19:56 +00:00
kr.angelov
836b953b9d an initial API for parsing and linearization from Python 2012-12-13 15:39:07 +00:00
kr.angelov
14e721dda9 a top-level API for parsing in the C runtime 2012-12-13 14:44:33 +00:00
kr.angelov
68249a11d2 bugfix: the outside probability of a PgfItemConts must always be initialized to zero 2012-12-13 11:11:45 +00:00
kr.angelov
2dc8236170 bugfix: pgf_read_expr no longer requires a semicolon at the end of an abstract expression 2012-12-13 11:09:26 +00:00
kr.angelov
0891ef3f0f an initial Python binding to the C runtime 2012-12-12 11:29:39 +00:00
kr.angelov
aa13090b66 started an official API to the C runtime 2012-12-12 11:25:58 +00:00
hallgren
5e091d2e3d partial evaluator work
* Evaluate operators once, not every time they are looked up
* Remember the list of parameter values instead of recomputing it from the
  pattern type every time a table selection is made.
* Quick fix for partial application of some predefined functions.
2012-12-11 15:37:41 +00:00
john.j.camilleri
2623925e67 Syntax editor: unwrap feature 2012-12-11 15:09:16 +00:00
john.j.camilleri
6ef74e13d6 Syntax editor: link to about page 2012-12-11 09:48:44 +00:00
john.j.camilleri
ba3a497e41 Syntax editor: add about.html (and a Makefile for generating it) 2012-12-11 09:42:57 +00:00
kr.angelov
5779887f96 bugfix for robust parsing with multi-word units 2012-12-11 12:57:22 +00:00
hallgren
93da60fa04 GF home page: link to the Resource Grammar Library coverage map by Tommi Nieminen 2012-12-10 15:17:55 +00:00
hallgren
621291a575 Compute.ConcreteNew: add missing case for variant functions
Also adding a test case in the test suite for this.
2012-12-10 13:25:32 +00:00
aarne
45a2629ee5 added functions to Ron and Chi needed for YAQL 2012-12-09 19:01:19 +00:00
aarne
768bec4073 superlative agreement and position in PhrasebookFre 2012-12-07 15:37:37 +00:00
john.j.camilleri
953b6b573a Syntax editor: change startcat when wrapping top node 2012-12-07 15:32:31 +00:00
aarne
c4931fccaf fixed external case for countries in PhrasebookFin 2012-12-07 15:25:27 +00:00
hallgren
46b634f256 update debian/changelog 2012-12-07 14:22:14 +00:00
hallgren
db7063ebcc Make -new-comp the default and bump the version number to 3.3.11-darcs
* -new-comp (the new partial evaluator) is now chosen by default when you run
  cabal install (or cabal configure). To revert to using the old partial
  evaluator by default, use "cabal install -f-new-comp" (or
  "cabal configure -f-new-comp").

* Regardless of the configured default, you can choose which partial evaluator
  to use when you invoke gf by using the -new-comp or -old-comp command line
  option.

* The cc command in the GF shell uses the chosen partial evaluator by default,
  but you can override this by using "cc -new" or "cc -old".

The plan is that these flags will be romeved in a future version.
2012-12-07 14:01:42 +00:00
john.j.camilleri
904e8029fe Syntax editor: various small improvements...
- separate tree edit buttons from option buttons
- fix bug when wrapping on freshly imported ast
- add interface for import & export of ast
- cleaner internal implementation of Editor.add_refinement
- small style updates
2012-12-07 12:55:17 +00:00
hallgren
81f843ac06 Compute.ConcreteNew: bug fix for indirectly defined pattern macros
More changes are probably needed to make pattern macros first class values.
Also includes minor changes related to variants and error messages.
2012-12-06 16:44:03 +00:00
john.j.camilleri
32f085a4b5 Syntax editor: wrap now handles multiple possible positions for subtree 2012-12-04 15:45:41 +00:00
aarne
f5e4385fdd MiniresourceChi added as a cloud demo grammars 2012-11-27 13:27:07 +00:00
john.j.camilleri
314052f8d3 Syntax editor: add wrap feature 2012-12-03 14:02:47 +00:00
kr.angelov
e174f37940 added experimental script for chunking in the C runtime 2012-12-03 10:07:54 +00:00
kr.angelov
6e3321d712 added INSTALL file and updated README file for the C runtime 2012-12-03 09:09:08 +00:00
aarne
03c3c57290 produce error message instead of failure of irrefutable pattern Ok ty_C in GrammarToPGF, to help find compilation errors; the ones I've found are because an inherited abstract excludes something that the inherited concrete does not exclude. 2012-12-02 19:40:45 +00:00
john.j.camilleri
0ac61fefba Syntax editor: internal optimizations by pre-computing certain stuff 2012-11-30 15:08:46 +00:00
john.j.camilleri
58c3e3db85 Syntax editor: in-place replacement of functions
When at a non-leaf node, refinements with identical type signatures
are highlighting and can re placed without destroying the children.
If not, the refinement is greyed and the user is asked to clear
the current subtree first if they wish to replace it.
This aspect of the UI should be polished, but at least it is obvious.
Also, some substantial optimizations can still be made to cache
the processed type signatures (which determine what can be replaced
in-place)
2012-11-30 10:56:42 +00:00
hallgren
3c900ee6a3 minibar: add a button to get detailed grammar info
After pressing the "i" button to view grammar info, there is now a
"More info" button to get more detailed information about all categories and
functions in the grammar.
2012-11-29 19:15:30 +00:00
hallgren
8c22a380f7 minibar: add tool tips to some of the buttons
Also move the functions title and attr from editor/editor.js to js/support.js.
Also mention recent changes in minibar/about.html.
2012-11-29 16:05:42 +00:00
john.j.camilleri
8cefec807a Syntax editor: internal improvements. re-introduce initialize_from function 2012-11-29 15:40:18 +00:00
john.j.camilleri
c3f82bf10f Syntax editor/minibar integration fix 2012-11-29 15:18:02 +00:00
hallgren
351661f427 Convert some documentation to UTF-8
Using

	%!encoding:utf-8

in txt2tags files ensures that the generated HTML includes an appropriate
charset declaration. This way we avoid relying on browser defaults, which can
be wrong.
2012-11-27 16:03:29 +00:00
hallgren
78216222f1 some documentation updates and fixes
doc/Makefile: add a rule to regenerate gf-help-full.txt
gf-help-full.txt: updated (new parse tree visualization options)
demo & cloud index: clarifications
minibar documentation: better layout on mobile devices
GF 3.4 release notes: reorganized & updated
2012-11-27 14:11:47 +00:00
john.j.camilleri
59b9676fd1 Syntax editor; add new helper for parsing type signatures (not complete) 2012-11-27 12:00:41 +00:00
john.j.camilleri
e9e29aab67 Syntax editor: add options for GM in editor_online.js 2012-11-27 11:21:28 +00:00
john.j.camilleri
45179a580a Syntax editor: avoid server calls for each refinement by using cached data 2012-11-27 11:19:12 +00:00
john.j.camilleri
b3c1177f9e Syntax editor: improvements and fixes with grammar manager 2012-11-27 10:09:40 +00:00
hallgren
def375e588 gfse: add Prelude to the list of RGL modules that can be opened 2012-11-26 15:08:16 +00:00
hallgren
818faee27e gfse: more readable layout for not so simple grammars + bug fix
To make definitions that span multiple lines more readable in guided mode,
preserve line breaks and indentation when lin and oper definitions are
displayed and edited in guided mode.

Bug fix: moving the cursor by clicking and selecting text by dragging did
not work in textareas and input fields, because those mouse event were
intercepted by the sort-by-drag-and-drop handler.
2012-11-26 14:11:12 +00:00
hallgren
18c8ff3579 gf -server + gfse: show modification time of public grammars 2012-11-23 23:21:17 +00:00
hallgren
bdaf7a8772 gf -server: support overloaded opers in gfse 2012-11-23 19:59:39 +00:00
hallgren
e0e8f89484 gfse: use POST requests when parsing grammar modules after editing as text
instead of GET, to avoid the Apache httpd URI length limitation.

This means that gfse can no longer use JSONP when parsing grammars, so it
has to be located on the same host as the cloud service.

Also clean away trailing white space in support.js.
2012-11-23 18:51:44 +00:00
hallgren
53858fbc81 Fix a prededence bug in GF grammar pretty printer
The pretty printer produced

	mkDet pre {"a"; "an" / vowel} Sg

which is not accepted by the parser. The parser assigns pre { ... }, to
prededence level 4, and this is now reflected in the pretty printer, so
it prints

	mkDet (pre {"a"; "an" / vowel}) Sg

(This caused a problem in GFSE since it parsers pretty printed grammars...)
2012-11-23 18:44:08 +00:00
aarne
4432d7c36c miniresource with one module per language for a web IDE demo 2012-11-23 15:57:00 +00:00
john.j.camilleri
22aeb04704 minibar_online.js: updated to launch Editor using a GrammarManager object 2012-11-23 15:07:51 +00:00
john.j.camilleri
d9867893f8 Syntax editor: now uses common GrammarManager object 2012-11-23 15:03:36 +00:00
hallgren
9e430184ba syntax editor + minibar: fix bug with repeated switching back and forth
By avoiding "this" in callback functions, the code can be kept cleaner.
2012-11-23 13:15:16 +00:00
john.j.camilleri
ee2f0a7487 Syntax editor: return to editor after having switched to minibar 2012-11-23 08:25:00 +00:00
john.j.camilleri
4e00ddea08 Minibar: call abstract_action with 'this' bound to minibar object 2012-11-23 08:21:00 +00:00
john.j.camilleri
c94e34d4e4 Minibar: add show/hide functions 2012-11-23 08:08:13 +00:00
hallgren
24bf1f0d0e minibar: can now switch back to the minibar after switching to the syntax editor
This is done by including a lin_action when starting the syntax editor from
the minibar.
Also: added some minibar options in the syntax editor for consistency...
2012-11-22 16:42:39 +00:00
hallgren
db544b1cc9 PGFService.hs: fix type error caused by change to PGF.graphvizParseTree
Note that some of the graphviz functions have backwards incompatible changes
that might also affect other clients of the PGF run-time library.

Also added graphvizDefaults and export it together with GraphvizOptions from 
the PGF run-time library.
2012-11-22 15:27:16 +00:00
john.j.camilleri
bac6b7fe64 Syntax editor: can now load minibar (in-place) from a linearised tree 2012-11-22 12:45:20 +00:00
peter.ljunglof
486a510611 better visualization of parse trees 2012-11-22 08:50:37 +00:00
peter.ljunglof
eebae7591c Added C compilation notes for Mac OSX 2012-11-22 08:50:49 +00:00
hallgren
7bcf05e3e7 minibar: fix bug introduced in previous update
It could case JavaScript error

	ReferenceError: initial_grammar is not defined
2012-11-21 19:01:52 +00:00
hallgren
e7b14316dd minibar+syntax editor integration, work in progress 2
+ Transfer current astract syntax tree when activating the syntax editor
  from the minibar.
+ Add options to start the minibar with given input. You need to include
  the current grammar url, the current language and the input, like this:

    initial_grammar: "/grammars/Foods.pgf",
    initial: { from: "FoodsEng", input:["that","fish","is","fresh"]}

+ Fix a style sheet clash.
2012-11-21 17:13:21 +00:00
john.j.camilleri
381dc3900c Syntax editor: start with initial AST
Note that the argument has been renamed to initial.abstr
(Where abstr means an abstract syntax tree in string form, NOT an AST object)
2012-11-21 15:24:44 +00:00
hallgren
8bd58a0297 minibar+syntax editor integration, work in progress 2012-11-21 15:07:59 +00:00
john.j.camilleri
051b7b0d21 Syntax editor: start with initial grammar, startcat, to: languages 2012-11-21 11:22:35 +00:00
john.j.camilleri
0f59b25d8a support.js: elem() returns false when as is undefined 2012-11-21 11:13:46 +00:00
hallgren
29d8b182ab gfse: remove obsolete files 2012-11-20 15:31:31 +00:00
hallgren
2ee6211fe1 GF cloud: move gf-web-api-examples.html out of minibar directory 2012-11-20 15:18:05 +00:00
john.j.camilleri
3f88302035 Update gf.cabal to copy new common js files 2012-11-20 14:04:09 +00:00
john.j.camilleri
09c4f8410e Syntax editor: update to use common js files 2012-11-20 13:56:56 +00:00
hallgren
3eaeaed8fd GF cloud: move support.js and pgf_online.js
Created the folder js and moved minibar/support.js and minibar/pgf_online.js
there, to emphasize their status as app independent support libraries.

There are probably more files that should be moved here.

The cloud apps have been updated, externally hosted apps that link directly
to our server need to be updated too.
2012-11-20 12:56:48 +00:00
john.j.camilleri
27beb9a3f8 Syntax editor: random generation of trees (and subtrees!) 2012-11-20 09:36:50 +00:00
kr.angelov
5e3b23325e remove the duplicated definition of PgfProductionIdx in parser.c 2012-11-19 14:16:31 +00:00
john.j.camilleri
bbd81b5d65 Fix date of 2013 summer school on home page (it said 2011) 2012-11-19 10:58:09 +00:00
aarne
61276878f6 index: news on summer school and Chinese 2012-11-19 09:58:26 +00:00
hallgren
889d7db76d GF web service API examples: update examples of the browse command
Also some style tweaks.
2012-11-17 17:42:30 +00:00
hallgren
ca5b066588 PGF service: command=browse&format=json returns info on all cats and funs
The browse command used to have a required parameter id=... and it returned
info on the given identifier only. Now, if format=json, the id=... parameter
can be omitted to get info on all identifiers at the same time. The returned
JSON structure in this case is

        {cats:{...},funs:{...}}

where the inner objects contain one field per category and function,
respectively, in the same format as when you request info on one category or
function.
2012-11-17 14:22:30 +00:00
hallgren
73c78c8840 GF web service API examples: added the "abstrjson" command
It converts an abstract syntax tree (represented as a string) to a JSON
structure.
Also some HTML code cleanup.
2012-11-17 11:55:32 +00:00
john.j.camilleri
3e5dac8ed4 Syntax editor: work on importing AST as string (eg for generate random)
But it's still not complete. Need an efficient way of getting the cat info to accompany funs.
2012-11-16 14:35:37 +00:00
kr.angelov
954d7a7ff5 bugfix for the building of bottom-up filter in the C runtime 2012-11-16 13:27:15 +00:00
hallgren
7d616c01b4 new-comp: rewrite f (x|y) into (f x|f y)
With this change, all languages in molto/mgl/mixture except German and Polish
can be compiled.
2012-11-16 13:47:10 +00:00
john.j.camilleri
67ca0a1eae Syntax editor: select subset of available languages
Also added a basic readme file with a list of todo's
2012-11-16 09:33:55 +00:00
hallgren
225cebf121 Updated summer school links
You can now use the following links to refer to GF Summer School web pages:

- Latest summer school: http://school.grammaticalframework.org/
- 2009 summer school: http://school.grammaticalframework.org/2009
- 2011 summer school: http://school.grammaticalframework.org/2011
- 2013 summer school: http://school.grammaticalframework.org/2013

This is accomplished with DNS and web server configuration. No files have
been moved, so this does not break any existing links (except that
http://school.grammaticalframework.org/ now refers to the latest summer school
instead of the 2011 summer school).
2012-11-15 21:05:10 +00:00
hallgren
9a49825d55 download/release-3.4.t2t: starting to prepare for the next release of GF
Feel free to add to the release notes.
The file can be renamed if the next release will not be called GF 3.4.
2012-11-15 19:33:42 +00:00
john.j.camilleri
f815b2850b Syntax editor: jump to next hole in tree 2012-11-15 15:38:17 +00:00
john.j.camilleri
dc0f333fec Syntax editor: fix bug in Firefox, Seamonkey 2012-11-15 12:40:14 +00:00
hallgren
2cc39661d9 Add flag --document-root for user with gf --server
This can make it easier to test cloud service updates before installing them.
2012-11-14 13:52:45 +00:00
hallgren
595a69ba0c GF usage message fixes
Change the command name from gfc to gf in the usage message header.
Correct spelling of "overide" to "override" in -gf-lib-path description.
2012-11-14 13:49:10 +00:00
kr.angelov
5c52eaf0b7 revised heuristic in the statistical parser 2012-11-14 12:34:22 +00:00
john.j.camilleri
5c8c1f768f Add first demo of new syntax editor
As part of the GF cloud stuff, it can be accessed from
http://cloud.grammaticalframework.org/syntax-editor/editor.html
2012-11-13 15:14:49 +00:00
hallgren
27e675910a Adding a new experimental partial evalutator
GF.Compile.Compute.ConcreteNew + two new modules contain a new
partial evaluator intended to solve some performance problems with the old
partial evalutator in GF.Compile.Compute.ConcreteLazy. It has been around for
a while, but is now complete enough to compile the RGL and the Phrasebook.

The old partial evaluator is still used by default. The new one can be activated
in two ways:

  - by using the command line option -new-comp when invoking GF.
  - by using cabal configure -fnew-comp to make -new-comp the default. In this
    case you can also use the command line option -old-comp to revert to the old
    partial evaluator.

In the GF shell, the cc command uses the old evaluator regardless of -new-comp
for now, but you can use "cc -new ..." to invoke the new evaluator.

With -new-comp, computations happen in GF.Compile.GeneratePMCFG instead of
GF.Compile.Optimize. This is implemented by testing the flag optNewComp in
both modules, to omit calls to the old partial evaluator from GF.Compile.Optimize
and add calls to the new partial evaluator in GF.Compile.GeneratePMCFG.
This also means that -new-comp effectively implies -noexpand.

In GF.Compile.CheckGrammar, there is a check that restricted inheritance is used
correctly. However, when -noexpand is used, this check causes unexpected errors,
so it has been converted to generate warnings, for now.

-new-comp no longer enables the new type checker in
GF.Compile.Typeckeck.ConcreteNew.

The GF version number has been bumped to 3.3.10-darcs
2012-11-13 14:09:15 +00:00
kr.angelov
468464faca bugfix in the statistical parser 2012-11-13 09:48:23 +00:00
kr.angelov
d1044b202a two simple heuristics which speed up the statistical parser more than seven times. 2012-11-12 22:17:40 +00:00
kr.angelov
182e366f5d a simple refactoring in the statistical parser 2012-11-12 21:48:22 +00:00
kr.angelov
7ad4436502 more counters in the profiler for the statistical parser 2012-11-12 15:36:21 +00:00
kr.angelov
9b2487243e now we store the state instead of the offset for every continuation in the chart for the statistical parser 2012-11-12 14:04:52 +00:00
kr.angelov
c28056c4e5 in the statistical parser: move the outside probability from the parse items to their continuation. this makes the value slot shared between many items 2012-11-12 13:43:43 +00:00
kr.angelov
56f3ff8202 small refactoring in the C runtime 2012-11-12 13:05:35 +00:00
kr.angelov
cce22a7f7a use size_t consistently as the type for constituent indices in the C runtime 2012-11-12 12:51:27 +00:00
kr.angelov
6784a4c76e implemented gu_map_count in runtime/c/gu/map.c 2012-11-12 12:42:19 +00:00
hallgren
63093c32f3 Eliminate warnings about deprecated use of catch and try
This is also needed for compatibility with GHC 7.6.
2012-11-08 15:53:46 +00:00
hallgren
1c0429c322 GF.Grammar.PatternMatch: relax overly restrictive type signatures 2012-11-07 17:23:08 +00:00
hallgren
8e6c81fe5a Some changed/new utility functions
GF.Data.Utilities:  Rename mapFst to apFst, mapSnd to apSnd.
		    Add apBoth, mapFst, mapSnd, mapBoth.
GF.Data.Operations: Remove onSnd (same as apSnd)
2012-11-07 15:31:45 +00:00
hallgren
1dbf575a71 gf -server: make it possible to pass arbitrary flags/options to gf when compiling grammars
For example, you can add -optimize-pgf:

  http://localhost:41296/cloud?dir=...&command=remake&-optimize-pgf=&Foods2Eng.gf=&Foods2Swe.gf=
2012-11-06 15:29:38 +00:00
virk.shafqat
cfcf7cbc7f unicode4k-changed 2012-11-05 16:44:31 +00:00
normundsg
17c6b26728 PhrasebookLav: synchronised with the latest changes in the resource grammar 2012-11-01 02:36:29 +00:00
hallgren
680d536279 TransQuiz: use the grammars from the same server
Unlike the other web apps in the cloud, the translation quiz was configured
to use the grammars at http://www.grammaticalframework.org/grammars.
2012-10-30 14:36:55 +00:00
john.j.camilleri
8a718d6945 Small update to summer school 2013 page 2012-10-30 13:41:20 +00:00
john.j.camilleri
372dc0b566 Add initial page for 2013 summer school 2012-10-30 13:32:42 +00:00
kr.angelov
c679b08b38 use prob_t instead of float in a few places 2012-10-29 08:52:56 +00:00
john.j.camilleri
377ce1732d Minibar: cursor over editable words is now a "hand"
This had been bugging me for ages!
2012-10-26 15:00:19 +00:00
hallgren
672584c048 GF home page: avoid line breaks in dates in the news section 2012-10-26 14:05:27 +00:00
hallgren
140f237736 gf.cabal: version of parallel needs to be >=3 2012-10-26 09:25:45 +00:00
john.j.camilleri
97f6e4b409 Added my name to authors list 2012-10-26 08:47:00 +00:00
kr.angelov
118333eee8 forgot to add one #ifdef 2012-10-25 18:37:22 +00:00
hallgren
b2965730f1 GF.Grammar.Macros: add function collectPattOp
collectPattOp :: (Patt -> [a]) -> Patt -> [a]
2012-10-25 16:12:21 +00:00
kr.angelov
d185938952 a major refactoring in the robust parser: bottom-up filtering and garbage collection for the chart 2012-10-25 14:42:53 +00:00
hallgren
619c341ee9 GF.Grammar.Macros: add function composPattOp
For Patt, analogous to composOp for Term.
2012-10-24 22:40:18 +00:00
hallgren
9f8c0f86f1 Compute.ConcreteNew: support variants
Also add a missing check for Predef values in apply.
2012-10-24 17:49:20 +00:00
hallgren
6fcd435cd9 GeneratePMCFG: prefix messages about "impossible" errors with 'Internal error:'
Just to make them easier to spot when wading through thousands of lines of
warnings...
2012-10-24 17:08:52 +00:00
hallgren
61647b1dac Link to the GF Developers Guide from the download page 2012-10-24 15:08:20 +00:00
hallgren
f7cb80008b gf-cloud-api.html: document the new command=remake
Also improve the documentation of the responses to the upload and make
commands.
2012-10-23 21:16:31 +00:00
hallgren
b810b5000c gf -server: introduce command=remake for recompiling previously uploaded grammars
Also remove some old commented out code.
2012-10-23 20:23:01 +00:00
hallgren
f273c643b5 fracas: code to generate HTML treebank 2012-10-23 12:55:32 +00:00
hallgren
bb93e18ec1 cleanup
Simplify the implementation of writeUTF8File and use it in one more place.
Remove unused imports left over after a previous change.
2012-10-23 11:48:23 +00:00
hallgren
0bf9627d79 Add Chinese to the list of installed RGL languages and support it in the web apps
Aarne says the Chinese resource grammar is complete, but not yet completely
correct.
2012-10-22 10:16:10 +00:00
hallgren
be75546965 Refactor compileSourceModule
There was 55 lines of rather repetitive code with calls to 6 compiler passes.
They have been replaced with 19 lines that call the 6 compiler passes
plus 26 lines of helper functions.
2012-10-19 20:14:11 +00:00
hallgren
1195db1da3 Consistenly use SourceGrammar instead of [SourceModule] when calling compiler passes 2012-10-19 19:56:00 +00:00
hallgren
921b37834c Phrasebook: make clean 2012-10-19 14:08:09 +00:00
inari.listenmaa
db81099c4f fixes to previous 2012-10-19 11:52:54 +00:00
inari.listenmaa
2c2c83f11c spanish_catalan_corrections 2012-10-19 11:45:45 +00:00
hallgren
584b6ba86d Use NOINLINE for build info and darcs version info
... to avoid unnecessary recompilation of other modules.
2012-10-18 20:01:22 +00:00
hallgren
9a022a141e gfse: grammars can now contain one-line descriptions
Also fixed two small problems with public grammars.
2012-10-18 12:48:39 +00:00
peter.ljunglof
36dd5502aa added autogenerated files for the FraCaS treebank 2012-10-17 08:49:34 +00:00
hallgren
7ca6426807 gfse: small fix 2012-10-16 23:06:37 +00:00
hallgren
d01e790d95 gfse: identify inherited grammars by their unique id
This helps avoiding problems if an inherited grammar is renamed, or if there
is more than one grammar with the same name.
2012-10-16 22:10:49 +00:00
hallgren
4c0c7a994b GF.Command.Command: turn CommandOutput into a newtype
The output from commands is represented as ([Expr],String), where the [Expr] is
used when data is piped between commands and the String is used for the final
output. The String can represent the same list of trees as the [Expr] and/or
contain diagnostic information.

Sometimes the data that is piped between commands is not a list of trees, but
e.g. a string or a list of strings. In those cases, functions like fromStrings
and toStrings are used to encode the data as a [Expr].

This patch introduces a newtype for CommandOutput and collects the functions
dealing with command output in one place to make it clearer what is going on.
It also makes it easier to change to a more direct representation of piped
data, and make pipes more "type safe", if desired.
2012-10-16 13:01:03 +00:00
aarne
e2817244a2 some fixes to make Phrasebook compilable more easily 2012-10-15 09:02:39 +00:00
hallgren
a3aa54a746 demo page: adding a link to the question answering demo from the ICFP 2012 GF tutorial 2012-10-12 15:33:38 +00:00
kr.angelov
93e3356d02 add teyjus/simulator/builtins/builtins.h 2012-10-11 11:10:17 +00:00
kr.angelov
b22075e15a added the forgoten libteyjus.pc.in file in the C runtime 2012-10-11 04:22:38 +00:00
hallgren
be84d37c41 gfse: adding a section about public grammars in about.html 2012-10-09 14:54:50 +00:00
hallgren
4c0b6f29f2 gfse: show the grammar list if the currently selected grammar can not be loaded
Avoid showing a blank page if there is an unexpected problem with the grammars
in localStorage.
2012-10-09 13:44:34 +00:00
hallgren
f53ab8b353 gf -server: /parse command now supports input with character codes > 255
This enables the use of arbitrary Unicode character in text mode in GFSE.
2012-10-09 13:14:18 +00:00
Normunds Gruzitis
c4faf2dddd PhrasebookLav: few more improvements
- Alternative variants in AScared.
- The order of adv. modifiers: first time, then place (PSeeYouPlaceDate).
- Fixed: the object valence in QWhatAge; Day.point linearization.
- PSeeYouPlaceDate is now less formal.
- Open/Closed and SeeYou functions are ok now, except that the word order in Open/Closed is a bit clumsy. TODO: "<what> <when> is open/closed" (currently not supported by the RG).
2012-10-08 07:30:16 +00:00
Normunds Gruzitis
5835c8ad58 PhrasebookLav: fixed four more functions and introduced few typical alternatives (paraphrases)
Fixed QWhatName, QWhatAge, HowMuchCost and ItCost, however, the solutions have to be reviewed.
Introduced a Lav-specific type for Language (affected also NPNationality etc.) to support a different realization of ASpeak.
Introduced alternative realizations for AHasName and ASpeak (the most typical/simple variant is the default one).
2012-10-06 21:16:46 +00:00
hallgren
b5bf276e9c Factor out code for setting the console encoding
Moved similar low-level code blocks in Main and GFI for setting the console
encoding to the new module GF.System.Console.
2012-10-05 12:54:49 +00:00
hallgren
2d371b7681 simple translator: make it usable on iOS devices
To make the popup menus accessible, use a simple trick to activate the
simulate-hovering-by-tapping behaviour.
2012-10-04 22:29:42 +00:00
hallgren
2afa20f197 simple translator: bug fix
"Edit/Add a segment..." stopped working at some point.
(Importing text still worked.)
2012-10-04 18:02:31 +00:00
hallgren
1eef49ac93 gfse: various code improvements and prelimiary support for public grammars 2012-10-04 15:21:30 +00:00
hallgren
ec9dc23f46 gfse: fix a bug caused by sharing when copying a linearization function in the row view
Functional programming is easier than imperative programming!
2012-10-03 13:54:35 +00:00
hallgren
3582ae6e08 gfse: some refactoring 2012-10-03 13:22:50 +00:00
hallgren
a1d2d11057 gfse: row view: add a button to copy a linearization
When adding a new function, you can enter a linearization for one language
and then copy it to the other languages with one button click.
2012-10-03 12:37:47 +00:00
hallgren
a47d2da448 gfse and cloud service documentation update 2012-10-02 17:32:52 +00:00
hallgren
92acb3691b index.html: better news formatting 2012-10-02 14:19:33 +00:00
hallgren
38f899350a index.html: change to and explicitly declare that the character encoding is UTF-8
...to avoid complaints from HTML validators and potential problems in browsers
with different default character encodings.
2012-10-02 13:57:10 +00:00
hallgren
63e589372e gfse: you can now add new functions from the matrix view 2012-10-02 13:50:35 +00:00
hallgren
357b8b33ba gfse: more intuitive buttons for switching between the column, matrix & row views 2012-10-02 13:09:56 +00:00
hallgren
24f362ec00 gfse: adding a "row" view
Accessed by clicking on a function in the Abstract column in the matrix view.
2012-10-01 21:08:09 +00:00
hallgren
a782207841 gfse: matrix view improvements
+ You can click on a column header to switch to column view (i.e. the
  corresponding abstract/concrete syntax tab).
+ The categories and functions in the abstract syntax can be edited directly
  in the matrix view.
2012-10-01 16:29:59 +00:00
hallgren
0790af56a8 demo page: update the links to Mathbar and GFSE to point to the latest version 2012-10-01 11:22:29 +00:00
kr.angelov
6e3503bb7b move examples/PennTreebank to /treebanks/PennTreebank 2012-10-01 08:52:54 +00:00
kr.angelov
de679b400a typechecking and better error reporting in the training script for PennTreebank 2012-10-01 08:45:46 +00:00
kr.angelov
6daeecb6d9 added the GF version of Talbanken which was imported by Malin 2012-10-01 08:33:43 +00:00
hallgren
00490c07dd gfse: small linearization type display adjustment 2012-09-30 19:53:57 +00:00
hallgren
5f3e3e8fa2 gfse: display "??" instead of "null" in linearization types when lincats are missing 2012-09-30 19:47:30 +00:00
hallgren
996f79f875 gfse: show the types of linearization functions when hovering over their names 2012-09-30 19:33:25 +00:00
hallgren
ca58233bf7 PGF service & minibar: put a limit on the number of parse trees
+ In the PGF web service API, the commands parse, translate and translategroup
  now accept a limit parameter. It limits the number of parse trees returned.
  If no limit is given, the behaviour is backwards compatible, i.e. no limit
  is applied.
+ In minibar, the limit is now set to 25 by default.

This change is based on a suggestion by Kaarel Kaljurand.
2012-09-30 15:35:25 +00:00
hallgren
94e6ee62ec Make two more page more mobile friendly 2012-09-28 20:55:30 +00:00
hallgren
ac6c8971fc Make the GF web site more mobile friendly
Most of the pages on the GF web site have an exemplary simple design,
with just one column of text. This make them adapt exceptionally
well to screens of different sizes. In particular, they should be
easy to read even on smartphones.

However, smartphone browsers like Mobile Safari and the default
Android Browser assume that pages do *not* adapt well to small
screens, so by default they emulate a big screen, forcing the user
to zoom in to a part of the page to be able to read it. By adding
the meta tag

  <meta name = "viewport" content = "width = device-width">

the big screen emulation can be turned off, allowing pages to be
formatted to fit the actual screen size and text to be displayed
at a readable size.
2012-09-28 20:26:13 +00:00
hallgren
999d02eb30 gfse & cloud improvements
+ Added "Symbolic" to the list of resource modules that can be opened.
+ Clicking on the name of an opened resource module now displays the list
  operations it provides. (Implemented using show_operations in the GF shell.)
+ Added a GF version info link to the cloud service start page.
2012-09-28 14:27:18 +00:00
hallgren
86d17827ee GF shell, show_operations: nicer looking types for linearization functions
Adding a lock field to the result type of linearization functions.
TODO: figure out how to add a lock field to the argument types too.
2012-09-28 12:38:26 +00:00
hallgren
8154e480dd GF shell, show_operations: also show the types of linearization functions
This is a simple change in GF.Grammar.Lookup.allOpers, which is used only in
the implementation of the show_operations command in the shell.

This is useful when importing a concrete syntax (like LexiconEng) as a resource.
However, the types don't always look as nice as I hoped...
2012-09-27 15:55:20 +00:00
hallgren
7e8bab04c5 Setup.hs: add Maltese to the list of known RGL languages, but don't compile it by default 2012-09-27 14:28:59 +00:00
hallgren
5e71c365d1 SIO bug fix
Line breaks were missing when capturing stdout. (putStrLn acted like putStr.)
2012-09-26 18:13:47 +00:00
hallgren
1b359acbf2 phrasbook/Compile.hs: make it work with ghc>=7.2 2012-09-26 15:37:37 +00:00
hallgren
63214d2bf6 gf -server: add a GF version info request
GF version info can now be obtained from http://localhost:41926/version
Also removed some unused imports.
2012-09-26 15:23:29 +00:00
hallgren
82c9354e0d Setup.hs: Persian does not support mkPresent 2012-09-26 15:21:34 +00:00
hallgren
81895ad067 Add Persian to the list of installed RGL langauges 2012-09-26 13:04:18 +00:00
hallgren
43d5016996 Use the SIO monad in the GF shell
+ The restrictions on arbitrary IO when GF is running in restricted mode is now
  enforced in the types.
+ This hopefully also solves an intermittent problem when accessing the GF
  shell through the web API provided by gf -server. This was visible in the
  Simple Translation Tool and probably caused by some low-level bug in the
  GHC IO libraries.
2012-09-25 19:08:33 +00:00
hallgren
1adc0ed9f7 GF.Infra.SIO.hs: adding the SIO monad (where S = Shell or Safe)
The SIO monad is a restriction of the IO monad with two purposes:

+ Access to arbitrary IO operations can be turned off by setting the environment
  variable GF_RESTRICTED. There is a limited set of IO operations that are
  considered safe and always allowed.

+ It allows output to stdout to be captured. This can be used in gf -server
  mode, where output of GF shell commands is made part of HTTP responses
  returned to clients.
2012-09-25 18:38:13 +00:00
hallgren
69de623c17 GF.Command.Commands: allCommands is now a constant
The dependency on PGFEnv has been moved from the list to the exec function of
the commands in the list. This means that the help command no longer needs
to generate a new list of commands and that the state of the shell
(type GF.Command.Interpreter.CommandEnv) no longer needs to contain the list
of commands.
2012-09-25 11:42:32 +00:00
kr.angelov
bf49f3c246 now the meta probability for a category is explicitly specified in the statistical model instead of computed internally. this avoids rounding errors while computing the sum of a large number of small values. 2012-09-24 09:37:21 +00:00
kr.angelov
8b28b89ffc in the robust parser we don't have to care about trees which yeld empty strings. this makes the parser a lot faster 2012-09-24 09:30:20 +00:00
aarne
0345bb5d7a refactoring German VP 2012-09-23 07:46:43 +00:00
hallgren
2f500e521d GFServer.hs: code improvements
Use a monad in the request handler to make the code a bit more modular and
readable.
2012-09-22 22:10:10 +00:00
hallgren
a9476634a4 gf -server: also restrict the paths of uploaded files 2012-09-21 14:53:11 +00:00
hallgren
d7890b628f gfse: added a new "matrix view" of grammars 2012-09-21 10:45:10 +00:00
hallgren
b3f6d3612b simple translator: make it possible to delete documents 2012-09-21 09:07:31 +00:00
hallgren
db39fdaa68 gf -server: improved security checks
+ More restrictive limits on which file paths can be downloaded and removed.
+ Add more extensions to the list of file types that may be removed. In
  particular, allow documents created by simple translation tool to be removed.
2012-09-21 09:00:48 +00:00
hallgren
6d24f74393 simple translator: bug fix
A bug in the line break change prevented text import from working.
2012-09-20 07:49:13 +00:00
aarne
c71c5b2140 link to ICFP slides, part 1 2012-09-18 13:44:36 +00:00
kr.angelov
fe3b5c1360 the Haskell runtime now exports 'functionsByCat' which returns the list of all functions for a given category 2012-09-18 09:48:21 +00:00
kr.angelov
a307ed6c75 the C runtime now has a type prob_t which is used only for probability values 2012-09-18 09:18:48 +00:00
kr.angelov
91ca7c9a1b catch all case in GenerateBC.genFun 2012-09-18 08:32:21 +00:00
aarne
ab173e4adc negative patterns in gfmorpho 2012-09-14 08:56:09 +00:00
hallgren
decefce6bc simple translator: accept DOS, Mac and Unix line breaks when importing text 2012-09-17 15:58:40 +00:00
hallgren
fa3c87fb64 minibar-api.html: documentation fixes 2012-09-17 15:52:57 +00:00
Normunds Gruzitis
900067b109 PhrasebookLav: the word order generated by "action" functions (ALike, ALive etc.) is now natural 2012-09-17 13:45:22 +00:00
hallgren
597a3d7573 doc/icfp-2012: adding a link to my slides 2012-09-14 21:18:36 +00:00
aarne
e4948050f5 make Lang for languages that have complete morphology when running make in lib/src 2012-09-13 07:20:57 +00:00
aarne
560bc7d38e example with computer terminology from the Wikipedia 2012-09-12 14:04:39 +00:00
aarne
acb3fa961e First version of a web server for morphological paradigms. 2012-09-12 12:52:03 +00:00
hallgren
38db61e34f doc/gf-developers: a few more small fixes 2012-09-11 19:08:50 +00:00
hallgren
8323e78b99 doc/gf-developers: fixed a typo 2012-09-11 18:43:40 +00:00
hallgren
8f85daa94a simple translator: export GlobalSight Download Files
TODO: consider using a better way to save to a local file
2012-09-11 14:30:09 +00:00
hallgren
0cc0a03ac9 simple translator: more work on GlobalSight support
Disable editing source segments in GlobalSight documents
2012-09-11 13:23:05 +00:00
hallgren
1874e932e3 simple translator: more work on GlobalSight support
+ Retain metadata from GlobalSight Download Files.
+ Disable adding&removing segments when editing a GlobalSight documents.
2012-09-10 21:16:58 +00:00
hallgren
ae528954a0 minibar: fix links to Wikipedia article on JSONP
Wikipedia moved it.
2012-09-09 23:06:26 +00:00
hallgren
c7fd975c77 simple translator: support for importing GlobalSight Download Files
TODO: support for export translations in the same format.
2012-09-09 21:17:31 +00:00
kr.angelov
a34e9482e7 The training script for the PennTreebank is updated to compute more statistics 2012-09-07 08:18:11 +00:00
kr.angelov
86b5ec7447 bugfix in the C parser 2012-09-06 14:52:19 +00:00
hallgren
997734c8ba Add type info to "Warning: ignoring lock fields in resolving..." 2012-09-06 13:15:48 +00:00
hallgren
ffd59fc226 simple translator: make it work even if Apertium is unavailable
Since Apertium is unavaiable at the moment, I can't check that things
still work properly when Aprtium *is* availalbe.
2012-08-30 13:09:22 +00:00
kr.angelov
545e48e881 another fix for teyjus 2012-08-30 08:09:30 +00:00
kr.angelov
3f0b8c55ec the loading of PGF files was broken by the Teyjus patch. Now this is fixed 2012-08-30 07:41:49 +00:00
peter.ljunglof
b416f5bbf7 Use nub' instead of nub in some places, remove some unused nub imports 2012-08-29 21:48:34 +00:00
peter.ljunglof
a7de16c34b Added an O(n log n) version of nub
The new nub is called nub', and it replaces the old sortNub which was 
not lazy and did not retain the order between the elements.
2012-08-29 21:45:10 +00:00
peter.ljunglof
e2ecdfed1f Emacs only recognizes utf-8, not UTF-8, in file headers 2012-08-29 21:40:49 +00:00
kr.angelov
f8fe23fda7 A basic infrastructure for generating Teyjus bytecode from the GF abstract syntax 2012-08-29 11:43:02 +00:00
aarne
27196778ac added Lav in compilation; commented out extensions of Words that are only available for a fraction of languages; fixed a couple of type errors in WordsLav, to be checked 2012-08-28 11:29:54 +00:00
hallgren
7862bfb15b minibar documentation URL typo fix 2012-08-27 15:00:37 +00:00
hallgren
dfcd61de00 minibar documentation updates 2012-08-27 14:56:10 +00:00
aarne
a15e907e80 typo in extmini 2012-08-24 12:31:32 +00:00
aarne
2b77d3e0b0 extended mini resource grammar in examples, with Eng, Ita, Cmn (Mandarin Chinese by Jolene) 2012-08-24 06:30:10 +00:00
Normunds Gruzitis
57b260508c Improvements to PhrasebookLav
AHasAge, AHasChildren, AHasRoom, AHasTable, ALike - "almost" done: phrases (cases) are grammatically correct, but the word order has to be changed (TODO in the resource grammar).
2012-08-23 13:12:08 +00:00
hallgren
098ddc129e Add 'make deb' to Makefile, for creating Debian packages
Also updated the debian/* files.
It should now be easy to create Debian packages under Ubuntu 11.10 & 12.04.
See also the notes in the Makefile.
2012-08-22 17:25:10 +00:00
Normunds Gruzitis
59c97c72b0 First (public) version of PhrasebookLav
Tested on Actions:
- Temp: AHasName, ALike.
- ToDo: AHasAge, AHasChildren, AHasRoom, AHasTable.
- FixMe (in the resource grammar):
+ YouPolMale/YouPolFemale agreement (AHungry, AIll, AMarried, AReady, AScared, AThirsty, ATired);
+ Missing commas in multiple ObjAndObj constructions (AWant);
+ Use (the currently missing) Irreg_Give (AWantGo).
2012-08-18 05:07:10 +00:00
hallgren
06c9e4999f Updated the GF Developers Guide
+ The instructions have been modernized and simplified slightly and should now
  work again. (I have not verified it on Windows.)
  Using 'cabal' instead of 'runghc Setup.hs' avoids some problems.
+ Also, download/index.html has simpler installation instructions sufficient
  for many users, so mention it in the main README file.
+ Also adjusted the main Makefile.
2012-08-06 16:14:47 +00:00
kr.angelov
3601b796e5 fix some warnings in teyjus 2012-08-03 12:30:01 +00:00
hallgren
7f6c248bf1 translator: keep cloud docs and local docs apart
+ show a cloud icon next to the document name if it is stored in the cloud
+ in addition to the name of the current document, remember if it is stored in
  the cloud, so that the right document is loaded next time you open the
  translator.
2012-08-02 12:54:15 +00:00
hallgren
2e968a01fa gfse: matching colors in cloud download/upload icons 2012-08-02 12:12:59 +00:00
hallgren
700982076c GFServer.hs: binary files can now be uploaded to the cloud
Karel wants to upload PGF files.
2012-08-01 18:10:00 +00:00
hallgren
89026eb963 gf-cloud-api.html: markup fix 2012-08-01 15:39:30 +00:00
kr.angelov
9fc7cac46f the first draft of GF.Compile.Instructions 2012-08-01 09:21:59 +00:00
kr.angelov
83b321d862 An initial import of the teyjus source code in the C runtime for GF. The two runtime are still not connected but the source code compiles. 2012-07-31 15:16:04 +00:00
hallgren
314662dd09 translator: code cleanup and bug fixes 2012-07-27 15:06:02 +00:00
hallgren
50c1635e34 translator: remove debug logging 2012-07-25 14:31:39 +00:00
hallgren
5c03e5f963 translator: per segment translation method selection 2012-07-25 14:27:27 +00:00
john.j.camilleri
9e3b89a2a8 GFEP: updated readme 2012-07-10 12:16:28 +00:00
john.j.camilleri
62b295aaee GFEP: added images for ontology grammar plugin 2012-07-10 12:15:28 +00:00
peter.ljunglof
94e2999ac5 Minor changes in Python export 2012-07-02 21:11:20 +00:00
aarne
a99eaa74ec github news, new languages in the list on index 2012-06-29 09:57:36 +00:00
peter.ljunglof
a162488b05 Fixed minor bug in prolog export 2012-06-28 07:01:29 +00:00
peter.ljunglof
7fb35be6e3 major changes to the prolog export 2012-06-27 23:29:05 +00:00
peter.ljunglof
97df099d07 cleanup in the python export 2012-06-27 23:27:01 +00:00
hallgren
241bef8a51 Experiment with parallel grammar checks
Introduced the function

	parallelCheck :: [Check a] -> Check [a]

that runs independent checks in parallel, potentially allowing faster grammar
compilation on multi-core computers, if you run gf with +RTS -N.

However, on my dual core laptop, this seems to slow down compilation somewhat
even though CPU utilization goes up as high as 170% at times.
(This is with GF compiled with GHC 7.0.4.)
2012-06-26 17:01:15 +00:00
hallgren
82a5c574b6 GF.Infra.CheckM: comment out unused Context argument 2012-06-26 15:08:18 +00:00
hallgren
b094274c0e Report many type errors instead of stopping after the first one
In GF.Compile.CheckGrammar, use a new topological sorting function that
groups independent judgements, allowing them all to be checked before
continuing or reporting errors.
2012-06-26 14:46:18 +00:00
hallgren
a38efe70c6 Fix for warning messages from checkMapRecover
Reimplemented it with the new function accumulateError.

Also keeping the formatting of errors and warnings unchanged for now, to avoid
potentially causing problems in the GF Eclipse Plugin.
2012-06-25 15:55:59 +00:00
aarne
bc8ce3f7ca removed spurious empty warnings 2012-06-25 14:47:09 +00:00
hallgren
382f472731 GF.Compile.Rename: report many errors instead of stopping after the first one
Using accumulated errors in the Check monad.

TODO: some errors are still not accumulated, but thanks to checkMapRecover
at least one error per judgement is reported.
2012-06-25 14:15:02 +00:00
hallgren
0a09f3e0b2 Check monad: support for accumulated errors
In addition to warnings, the Check monad in GF.Infra.CheckM can now accumulate
errors. There are two new functions

	checkAccumError: Message -> Check ()
	accumulateError :: (a -> Check a) -> a -> Check a

The former (with the same type as checkWarn) is used to report an accumulated
(nonfatal) error. The latter converts fatal errors into accumulated errors.

Accumulated errors are reported as regular errors by runCheck.

Also, the Check monad type has been made abstract.
2012-06-25 14:01:58 +00:00
peter.ljunglof
deec2d4ecf Export PGF in Python format 2012-06-25 14:16:24 +00:00
aarne
98a967a173 warnings shown in checkMapRecover 2012-06-25 11:49:50 +00:00
aarne
d15e0f775d checkMapRecover: find undefined idents in all jments in Rename 2012-06-25 11:14:52 +00:00
aarne
3dc2e55949 printing ResValue judgements as comments, to provide useful information when a conflict is found between parameter constructors 2012-06-25 09:24:04 +00:00
ramona.enache
43065d2ccf cleaned up the patents query grammar 2012-06-25 10:34:55 +00:00
aarne
4a778acdad overload problem in Phrasebook fixed 2012-06-22 09:02:13 +00:00
hallgren
650abc4aff translator: parallel text view layout adjustments
And some other small code changes.
2012-06-21 23:06:07 +00:00
hallgren
cd2601bd84 translator: bug fix for copy/paste import 2012-06-21 23:03:12 +00:00
hallgren
b12e6ec1e4 gfse/sort.js: make it more resusable
Move the gfse-specific list of sortable tags and class names from sort.js
to editor.js.
2012-06-21 15:39:31 +00:00
ramona.enache
ffa1e7731d added French grammar for patent queries 2012-06-21 14:21:18 +00:00
hallgren
6e2c7623fd translator: insert and delete segments
You can now insert new segments anywhere, now just at the end.
You can now delete any segment, not just the last one.
2012-06-21 14:14:36 +00:00
ramona.enache
5a8c8de789 added patents queries in new_patentsQuery 2012-06-21 11:17:34 +00:00
ramona.enache
7af649f278 fixed and completed the patent query grammr for English 2012-06-21 10:45:05 +00:00
aarne
92a106339f QueryFre instances, don't compile yet because of type discrepancies 2012-06-21 06:22:47 +00:00
aarne
f8e74c50e2 factored Query by taking our Proton parts and introducing an interface 2012-06-21 06:06:05 +00:00
aarne
18c08fdac1 removed gfo files from query dir 2012-06-21 06:05:27 +00:00
hallgren
aa1cd0e490 gf-people.html: updated some broken links
www.cs.chalmers.se -> www.cse.chalmers.se
2012-06-20 20:40:26 +00:00
ramona.enache
f819b20ab2 added first draft of patents query grammar 2012-06-20 14:33:55 +00:00
hallgren
2df13efeea GF home page: link to PGF library API documentation 2012-06-20 12:04:04 +00:00
hallgren
9d9c453a45 translator: style adjustments 2012-06-19 14:45:50 +00:00
hallgren
b84f6cc3fc translator: expanatory text for local file import 2012-06-19 14:09:24 +00:00
hallgren
9bee6a9050 translator: import text from local files
It works in Chrome, Firefox and Opera, but not Safari.
(The browser must support the File, FileList and FileReader APIs.)
2012-06-19 13:59:19 +00:00
hallgren
3d5efdd2d2 GF cloud api doc fixes 2012-06-18 15:18:02 +00:00
hallgren
71da012626 cloud service: add preliminary cloud service API documentation 2012-06-18 13:08:32 +00:00
hallgren
c3a5840ef9 transaltor: reduce code duplication 2012-06-18 13:08:15 +00:00
hallgren
b76d1ecdcd Add file name to error message when reading a bad .gfo file (in some cases)
This turns error messages like 

	gf: too few bytes. Failed reading at byte position 1

	gf: /some/path/somefile.gfo: too few bytes. Failed reading at byte position 1

but a better fix would be to ignore bad .gfo files and compile from source.
The problem is the way this decision is made in
GF.Compile.ReadFiles.selectFormat...
2012-06-15 10:15:16 +00:00
hallgren
ce21f9bd08 translator: added support for the Apertium translation service
Also added feedback to source & target language menus to indicate which
languages are supported by the selected translation method. For Apertium, the
source language menu shows all possible source languages, and the target menu
shows the possible target languages for the chosen source language.
2012-06-13 21:34:59 +00:00
john.j.camilleri
8538f34ac8 GFEP: updated readme 2012-06-13 11:22:15 +00:00
kr.angelov
3ad5493758 Use a separated tag for meta productions in the robust parser. This cleans up the code a lot 2012-06-13 05:49:30 +00:00
hallgren
cc58e2d05f translator: documents can now be saved in the cloud
some other small fixes
2012-06-12 15:36:41 +00:00
hallgren
3af1dbde67 gfse & translator: change language code for Japanese to Jpn 2012-06-12 13:07:54 +00:00
hallgren
f5afb024ef gf-help-full.txt: updated with new command option 'ma -known' 2012-06-12 11:34:47 +00:00
kr.angelov
c9c5675e1d now there is a limit of 2000000 items in the chart of the robust parser. This prevents from explosion in the memory size but it will also prevent us from parsing some sentences. 2012-06-12 11:30:01 +00:00
john.j.camilleri
90306fa926 GFEP: updated readme 2012-06-12 11:27:23 +00:00
john.j.camilleri
f5a4514ac6 GFEP: updated readme 2012-06-12 11:04:59 +00:00
kr.angelov
808c52744f improved script for training from PennTreebank 2012-06-12 10:05:17 +00:00
kr.angelov
b27a440ef3 now the robust parser is purely top-down and the meta rules compete on a fair basis with the grammar rules 2012-06-12 09:29:51 +00:00
aarne
d989005e01 tried to change Jap to Jpn everywhere 2012-06-11 20:08:14 +00:00
hallgren
09f5c2c82b minibar-api.html: small documentation improvements 2012-06-11 16:00:03 +00:00
hallgren
5db5c8a203 GF home page: link to GF clouds service (cloud.grammaticalframework.org)
Also some small cloud service documentation updates.
2012-06-11 15:34:16 +00:00
hallgren
a026b93ecb translator: source segments can now be edited 2012-06-11 14:10:26 +00:00
john.j.camilleri
28e11999e2 GFEP: updated readme 2012-06-11 08:32:16 +00:00
john.j.camilleri
8a7fac37f0 GFEP: updated readme 2012-06-11 08:29:52 +00:00
john.j.camilleri
a563bf3f20 GFEP: updated readme 2012-06-11 08:29:12 +00:00
john.j.camilleri
b478596093 GFEP: updated readme 2012-06-11 08:15:35 +00:00
aarne
191ecc71b8 command option ma -known to drop unknown words 2012-06-10 10:43:57 +00:00
gregoire.detrez
12b2a0d665 Small Setup.hs bug fix
Setup.hs failed to generate DarcsVersion_gf if dist/build/autogen does not exists.g
Added a line to create the directory if absent.
2012-06-09 12:49:01 +00:00
hallgren
302b9f1b13 More detailed version info in the output of "gf -version" 2012-06-08 11:17:46 +00:00
hallgren
e9abd71899 translator.css: restore lost width of input field 2012-06-08 11:16:21 +00:00
john.j.camilleri
e778619f80 GFEP: updated readme and removed examples folder 2012-06-01 14:21:26 +00:00
john.j.camilleri
a86085d8ac GFEP: updated readme 2012-06-01 12:45:39 +00:00
john.j.camilleri
36a5b14cfa GFEP: Updated readme 2012-06-01 12:43:44 +00:00
hallgren
22e1a5b9f7 Setup.hs: fix two problems with querying darcs 2012-05-30 16:15:59 +00:00
hallgren
13cda24924 More detailed version info in the startup message
The Setup.hs script now queries darcs to create more detailed version info
to include in the startup message.

Note thought that with distributed version control systems like darcs,
the only way to uniquely identify a version is by the set of patches included.
Since the patches are not totally ordered, just looking at the last patch is
not enough.

For official releases, we tag the current set of patches so we can refer to
it by name (e.g. RELEASE-3.3.3).
2012-05-30 15:45:45 +00:00
hallgren
7196bc8669 translator: segment imported text based on punctuation 2012-05-29 14:47:59 +00:00
hallgren
9e34a7f7fa translator: better support for ambiguous translations
The translator picks "the first" translation by default, but the user can
choose among the generated translations from a popup menu.
2012-05-28 16:42:02 +00:00
hallgren
b19ae37d9c GFServer.hs: apply UTF8 encoding when saving uploaded files
This fixes a bug introduced on May 16.
2012-05-28 11:21:30 +00:00
hallgren
943652a3d2 translator: adding "Parallel texts" view
This is in addition to the existing "Segment by Segment" view.
Also some minor documentation updates.
2012-05-27 19:19:54 +00:00
hallgren
1215f2b951 gf -server: remove debug output 2012-05-27 11:52:15 +00:00
hallgren
9e32e9fde7 translator: you can now import text by copying and pasting 2012-05-25 16:48:03 +00:00
kr.angelov
06f9965d27 the viterbi probability for the epsilon categories is now updated properly 2012-05-25 07:30:35 +00:00
kr.angelov
ea5fe32d89 fixed an alignment bug in libgu which leads to crash on some platforms 2012-05-25 07:29:29 +00:00
kr.angelov
92488a6592 fixed memory leak in the pgf-translate tool 2012-05-25 07:28:18 +00:00
kr.angelov
5312ef23c6 added pgf-service.c in the robust parser' 2012-05-25 07:27:29 +00:00
hallgren
215ec25a41 translator: use a more robust test for localStorage support and show a warning if it is missing 2012-05-23 14:39:05 +00:00
kr.angelov
f4c17cb7aa another attempt to port the robust parser to MacOS 2012-05-16 15:18:44 +00:00
hallgren
6f328c9040 translator: fix typo 2012-05-16 14:56:32 +00:00
hallgren
7c8a744ad1 translator: update About page 2012-05-16 14:54:16 +00:00
hallgren
5bd17709bf translator: use GF's text lexer/unlexer to obtain more natural looking text
Note though that the unlexer does the wrong thing with initial words that are
supposed to be capitalized, e.g. "I am ready.", "Spanish wine is good.", so
these sentenses are not translated at the moment.
2012-05-16 14:42:26 +00:00
hallgren
114788a3db GFServer.hs: apply UTF8 decoding to all server input 2012-05-16 14:03:09 +00:00
hallgren
5ac7bfc326 translator: file browser shows files alphabetically now 2012-05-16 13:25:18 +00:00
kr.angelov
d2e528c7f4 small fix for compiling the robust parser on MacOS 2012-05-16 12:18:50 +00:00
hallgren
adffb5f872 translator: bug fix
My menu hiding hack didn't work in Gecko browsers because of a difference in
the behaviour of the JavaScript setTimeout function.
2012-05-16 11:53:27 +00:00
hallgren
66e6b5269d Adding a Simple Translation Tool
It is part of the cloud services available with gf -server.
2012-05-15 15:36:06 +00:00
hallgren
e90e1202c4 Integrate Japanese
* Update Setup.hs to build Japanese by default.
* News item about Japanese on the home page.
* Add Japanese to the supported RGL imports in the grammar editor (gfse).
2012-05-15 13:11:32 +00:00
hallgren
74cd9c4979 Quick updates to doc/gf-developers.t2t 2012-05-15 12:51:58 +00:00
aarne
a2bae03824 missing case in partial evaluation of + fixed 2012-05-15 11:48:30 +00:00
aarne
dcbb31cae2 Emil Djupfeldt's correction to PhrasebookGer 2012-05-08 12:10:36 +00:00
kr.angelov
a6800fc0da a new unbiased statistical parser. it is still far from perfect use it on your own risk. 2012-05-08 12:13:28 +00:00
kr.angelov
931066f6fc yet another fix for parsing literals 2012-04-18 15:50:55 +00:00
kr.angelov
17bc8e5c89 some fixes in the robust parser and a new API for literals 2012-04-12 06:55:25 +00:00
hallgren
26ffcdbde8 Demos: add a note that the WebAlt Math translator is out of order 2012-05-04 12:52:05 +00:00
hallgren
841e54e3dc alex 3 incompatibility workaround
As a temporary workaround, alex is no longer invoked automatically when
building with cabal. Developers who want to modify the lexer need to run
alex on Lexer.x manually and record the modified Lexer.hs.

    src/compiler/GF/Grammar/lexer/Lexer.x    -- hidden from cabal
    src/compiler/GF/Grammar/Lexer.hs         -- update it manually
2012-05-04 12:39:07 +00:00
hallgren
3022c7d08e minibar_offline: fix the link to the regular minibar 2012-04-30 14:03:58 +00:00
hallgren
c10bd79e26 minibar_offline: Update the API exported by pgf_offline.js to be compatible with pgf_online.js
This makes the minibar offline demo work again.
2012-04-30 13:53:55 +00:00
hallgren
c6c9b994d2 minibar: word-for-word replacements: use concrete syntax for replacement words when possible
Instead of showing the name of a function in the abstract syntax, linearize it
and show the result. For functions with argument, e.g. That : Kind -> Item,
the function is applied to the right number of placeholder arguments: 'That ?'.
If the linearization fails, the name of the function is shown anyway.
2012-04-27 14:00:01 +00:00
hallgren
c69f69ee9c minibar&gfse: grammar extension user interface improvements
The grammar extension is now done with a regular HTML form, so you can use the
TAB key to move between the fields and press ENTER to submit the extension when
you are done.
TODO: more immediate error feedback
2012-04-24 17:13:33 +00:00
hallgren
9d47b83e07 minibar & cloud service: minor style changes
Also include the GF logo on the cloud service start page.
2012-04-19 15:34:56 +00:00
hallgren
98ed039498 Minibar documentation update
Document recent additions in minibar/about.html.
2012-04-19 12:36:03 +00:00
john.j.camilleri
78c1af2ad9 GFEP: updated readme for 1.5.0 2012-04-19 09:44:42 +00:00
hallgren
ff812613c8 minibar: add buttons to use generated translations as input
This functionality was available in the origial Fridge Poetry app, but has been
missing in minibar until now.
2012-04-18 16:26:49 +00:00
hallgren
6dc12cfed9 download page: fixed a typo 2012-04-14 11:50:11 +00:00
hallgren
13ce1911da download page: added a note that Xcode 3.2.3 or later is needed on Mac OS X
The Haskell Platform page for Mac states that Xcode 3.2 or later is ok, but
there seems to be a problem with Xcode 3.2.2.

Also added some other small clarifications.
2012-04-14 10:03:27 +00:00
hallgren
baadce4acd minibar: fix to prevent the typed input field from losing focus when turning word-for-word replacment on or off 2012-04-11 14:03:39 +00:00
hallgren
68e2c0c0eb minibar: internal state type change
The current intput is now represented as an array of words instead of as a
string.
(This is the kind of change is scary to do in a dynamically type language
like JavaScript. In a statically typed language like Haskell you can do it
with confidence, since you know the compiler can help you catch all mistakes...)
2012-04-10 18:00:13 +00:00
hallgren
89b415ac37 minibar_input.js: internal state simplification
Get rid of list of previous states, which was only used to delete the last
word.
2012-04-10 16:49:51 +00:00
hallgren
500daf3bd4 minibar/pgf_online.js: pass arguments to the browse function in the same way as the other functions
Also document it in gf-web-api-examples.html.
2012-04-10 13:33:12 +00:00
hallgren
8b6817754b minibar&gfse: grammar extension user interface fixes
It works OK now, but it could be better, e.g. the number of mouse clicks
required to enter an extension could to be reduced...
2012-04-05 15:25:10 +00:00
hallgren
43c28ad276 minibar&gfse: first working grammar extension interface in minibar
There are still some user interface wrinkles to iron out.
2012-04-04 17:00:25 +00:00
john.j.camilleri
01a0f1d3e6 GFEP: updated readme 2012-04-04 10:19:11 +00:00
john.j.camilleri
57e927df91 GFEP: updated readme 2012-04-04 08:00:56 +00:00
hallgren
a4a154e5e2 minibar: remember current input
If you leave the minibar and later return, the previous input will be
restored. One input string per grammar is rememebered, so you can also switch
back and forth between grammars without losing the input.
This is implemented using localStorage, i.e. the data is stored locally on
the user's device.
2012-04-03 14:53:23 +00:00
kr.angelov
6644d93ec2 simple cleanup in the robust parser 2012-04-02 19:01:18 +00:00
hallgren
7ee66302d1 minibar: better implementation of word replacement
Instead of trying to reconstruct the abstract tree from the bracketed string,
use the node numbers (the field called "fid") to identify which node in the
abstact syntax tree a word in the bracketed string corresponds to.
2012-04-02 16:05:11 +00:00
hallgren
c2a72daa74 gf-server.cabal: mtl is needed to build pgf-server now 2012-04-02 15:58:21 +00:00
hallgren
1c1679227e PGFService.hs: add web API function "abstrjson"
Abstract syntax trees are represented as strings in the web API. To make them
easier to manipulate in JavaScript, the new function converts them to JSON.

To support structural editing, the nodes are numbered in the same way as in
the bracketed string created when linearizing an abstract syntax tree.

Example: "Pred (That Fish) Fresh" is converted to

	{fun:"Pred",fid:3,
	 children:[{fun:"That",fid:1,
		    children:[{fun:"Fish",fid:0}]},
		   {fun:"Fresh",fid:2}]}
2012-04-02 15:42:43 +00:00
hallgren
1db4fab25c support.js: add an implementation of Array.isArray for older browsers that lack it 2012-04-01 18:23:28 +00:00
hallgren
07b2e41c2c gf.cabal: removing -O2
Removing "ghc-options: -O2" from gf.cabal has the following advantages:

+ Compiling GF is faster (time drops from 182s to 142s on my laptop)
+ Compiling the RGL is faster (time drops from 159s to 155s on my laptop)
+ Without the hardwired optimization level, the 'cabal configure' options
  --enable-optimization=<n> and --disable-optimization work as expected
  (so if you still want -O2, use --enable-optimization=2)
+ GF can be compiled with ghc-7.2.2 and ghc-7.4.1 (-O2 triggers a bug in
  these versions of ghc, it seems. Another workaround, discovered by
  Sergei Trofimovich, is to use -O0 in Data.Binary.)
2012-03-30 15:07:12 +00:00
hallgren
e85a3fff56 gfse&minibar: work in progress on grammar extension fromminibar 2012-03-29 17:10:36 +00:00
hallgren
a519d01754 gfse: show an informative error message in browsers that lack support for localStorage 2012-03-29 14:11:38 +00:00
john.j.camilleri
0f04d88903 GFEP: page is now valid HTML and uses the gf.org stylesheet 2012-03-28 12:52:12 +00:00
hallgren
47c116b5a6 Workaround for bug in ghc-7.2.2
An apparent bug in ghc-7.2.2 causes the type Value to be exported from PGF.Data.
Workaround: restrict the imports from PGF.Data in GF.Command.Abstract and
GF.Compile.GeneratePMCFG to avoid the clash with locally defined type Value.
(ghc-7.0.4 and ghc-7.4.1 appear to be free from this bug.)
2012-03-26 23:56:56 +00:00
Sergei Trofimovich
c015ac77bd compiler/GF/Text/Coding.hs: fix build failure against ghc-7.2 2012-03-26 20:48:57 +00:00
Sergei Trofimovich
24740d250b Fix List.foldl / Map.foldl ambiguosity
Fixes the following error:
src/runtime/haskell/PGF/Expr.hs:111:14:
    Ambiguous occurrence `foldl'
    It could refer to either `List.foldl',
                             imported from `Data.List' at src/runtime/haskell/PGF/Expr.hs:27:1-24
                             (and originally defined in `GHC.List')
                          or `Map.foldl',
                             imported from `Data.Map' at src/runtime/haskell/PGF/Expr.hs:28:1-40
2012-03-26 20:18:23 +00:00
hallgren
a8ddb8fe5c minibar: support for adding grammars from several servers to the grammar menu
You can also add grammars from several directories on the same server of course.
The included minibar configuration file adds the user's own grammars from the
grammar editor.
2012-03-26 17:17:54 +00:00
hallgren
9a6887aa49 gfse: enable word replacement in minibar when activated from the editor 2012-03-26 17:13:40 +00:00
hallgren
671c9b5390 gfse&minibar: fix bug caused by function name clash
+ Function div_id was defined in both editor.js and support.js. Solution:
  moved the more general version from editor.js to support.js.
+ Function div_class was defined in both editor.js and support.js. Solution:
  resolv incompatibility with an argument type test and put the generalized
  function in support.js.
2012-03-26 17:08:29 +00:00
hallgren
14e7125958 gf-book: apply GF style sheet
Also brought index.txt and index.html back in sync. (It looks like someone
updated index.html instead of updating index.txt and regenerating index.html.)
2012-03-26 15:02:15 +00:00
hallgren
ddf1ae4626 doc/icfp-2012.t2t: link back to ICFP 2012 web site 2012-03-23 13:27:08 +00:00
hallgren
9f6293d314 GF home page: News: GF Tutorial at ICFP 2012 2012-03-23 13:20:58 +00:00
hallgren
4673aeca7b minibar: word-for-word replacement fixes
Check that the reconstructed abstract syntax tree is type correct before
enabling word-for-word replacement. Show an error message if word replacement
nevertheless fails.
2012-03-22 14:33:42 +00:00
hallgren
f8ea4b8046 pgf_online.js: error callbacks
To enable customized error handling, the methods in the pgf_online objects and
the AJAX server call functions in support.js accept an error callback function
as an extra argument, in addition to the callback (continuation) for normal
results.
2012-03-22 14:09:53 +00:00
john.j.camilleri
604b1634b4 GFEP: updated readme 2012-03-22 08:51:37 +00:00
john.j.camilleri
cc611843a2 GFEP: updated readme 2012-03-21 10:00:24 +00:00
hallgren
38162e0f53 ICFP 2012 tutorial page: use the GF stylesheet for a consistent look 2012-03-20 14:04:57 +00:00
hallgren
0d57b9fa09 minibar: word-for-word replacement fix
Turn off the highlighting that indicates that word-for-word replacement is
enabled when it is no longer available (e.g if a word is deleted and there no
longer is a complete parse).
2012-03-19 15:24:35 +00:00
hallgren
428c2184fa minibar: fix for recently introduced bug affacting Webkit browsers
It seems that in Gecko browsers, the effect of "with(x) stmts" reaches inside
the bodies of local functions in stmts, but in Webkit browers it does not.
2012-03-19 15:15:47 +00:00
john.j.camilleri
5a263337ce GFEP: added more images for readme 2012-03-19 13:45:04 +00:00
john.j.camilleri
7d34f76375 GFEP: Added video tutorial 2012-03-19 12:48:30 +00:00
hallgren
387deecd31 minibar: don't try to select the most recently used grammar if it isn't in the current grammar list 2012-03-19 00:35:10 +00:00
hallgren
0591f77658 minibar: automatically select the most recently used grammar when returning to the minibar 2012-03-18 23:54:50 +00:00
hallgren
07af8988d3 PGF run-time library: function names in BracketedString (experimental)
+ Make room for function names in the BracketedString data structure.
+ Fill in function names when linearizing an abstract syntax tree to a
  BracketedString.
+ Fill in wildCId when it is not obvious what the function is.
+ Function bracketedLinearize: for compatibility with the other linearization
  functions, return Leaf "" instead of error "cannot linearize".
+ Export flattenBracketedString from module PGF.
+ PGFServce: make function names available in the JSON representation of
  BracketedString.
2012-03-18 20:12:26 +00:00
hallgren
771c1a0ad7 minibar: word-for-word replacement (experimental)
The new functionality also needs some new PGF service functionality, which will
be provided in a separate patch.
2012-03-18 20:02:11 +00:00
hallgren
63e531ad39 Cloud service start page layout fix for small screens 2012-03-17 16:23:54 +00:00
aarne
45b64f5032 icfp tutorial web page 2012-03-17 14:13:42 +00:00
hallgren
13ecc8bdc3 Adding a .ghci file to make it easier to load GF in ghci. 2012-03-16 14:01:29 +00:00
hallgren
7c484aeada PGFService.hs: command=browse can now produce output in JSON format.
To get JSON output, add the parameter format=json. The JSON structure contains
the output from the function PGF.browse.
The default is format=html for backwards compatibility.
2012-03-16 13:55:19 +00:00
kr.angelov
230f309317 libpgf: a new implementation for literals which also allows custom literals. the same mechanism is now used for the metavariables 2012-03-12 14:25:51 +00:00
kr.angelov
1726995921 libpgf: added simple lexer 2012-03-09 09:14:44 +00:00
hallgren
d536d02d9b minibar: add an option to make it easy to select png or svg output
for abstract synax trees, parse trees and word alignment diagrams.
2012-03-08 15:30:31 +00:00
hallgren
ff7d964e19 GF home page: direct link to Issues
"Wiki" is a word with very low information scent: there is no way to know
what type of informaiton is hiding behind the Wiki link, e.g., that there is
a bug tracker (or an FAQ), so not many users will click on it.
2012-03-08 15:24:26 +00:00
hallgren
53fd2c811b gf.cabal: update version number to 3.3.3-darcs 2012-03-08 13:03:25 +00:00
hallgren
0722f6f444 PGFService.hs: add output format option to the commands abstrtree, parsetree and alignment
Supported output formats: gv, png, svg.
2012-03-08 11:25:15 +00:00
kr.angelov
ed5de8335b libpgf: implementation for built in literal categories 2012-03-07 16:39:29 +00:00
kr.angelov
96493c274b libpgf: simple fix in the parser debugger 2012-03-07 12:23:07 +00:00
kr.angelov
a96da30489 libpgf: two APIs - one for finding all parse results and another for finding the best parse result 2012-03-07 11:00:17 +00:00
hallgren
d6c2943ad1 gfse: small usability improvements 2012-03-06 23:04:36 +00:00
john.j.camilleri
4a4255c1f0 GFEP: updated page 2012-03-06 12:07:51 +00:00
aarne
f254312595 added Pes to the list of langs in make Symbolic 2012-03-06 07:20:31 +00:00
hallgren
d50c353fd3 gfse: more helpful hints about grammar parts and RGL modules 2012-03-05 21:12:33 +00:00
hallgren
6ee74e5df5 gfse: bug fix: avoid hickup when inhertiting from a missing concrete syntax 2012-03-05 20:47:52 +00:00
hallgren
a55588aad5 gf-server.cabal: always build the fastcgi module (pgf-server), lower version requirement on the cgi package
+ The flag fastcgi is removed: building the fastcgi is the main purpose of
  this cabal file again.
+ pgf-http superseded by gf-server, but is still available as an option
+ Require cgi>=3001.7.3 instead of cgi>=3001.8.0.
2012-03-05 16:38:54 +00:00
john.j.camilleri
ca58048f28 GFEP: Updated readme, more screenshots 2012-03-05 15:17:15 +00:00
aarne
de14021d25 Phrasebook now compiles for Hin and Pes 2012-03-05 15:13:28 +00:00
aarne
66a0fb0732 some additions to help compile PhrasebookUrd and Pes 2012-03-05 13:28:56 +00:00
hallgren
7df6ce1f77 minibar: tool tip on the feedback button and hint in the feedback form
that the user should select a language from the To: menu to suggest a better
translation to a particular language.
2012-03-05 14:54:42 +00:00
virk.shafqat
696e5c290d extrahin 2012-03-05 14:02:15 +00:00
kr.angelov
0e90d1ba1f libpgf: now all concrete functions and categories are explicitly linked to their abstract counter parts 2012-03-05 12:59:31 +00:00
john.j.camilleri
04db5aa045 GFEP: more screenshots 2012-03-05 11:50:20 +00:00
john.j.camilleri
7c00e81fb5 GFEP: updated readme 2012-03-05 10:39:14 +00:00
john.j.camilleri
6f6371e1bf GFEP: updated screenshots 2012-03-05 10:37:25 +00:00
john.j.camilleri
f6242702f5 GFEP: updated examples 2012-03-05 09:50:29 +00:00
virk.shafqat
f4fb8fe57d HinPesPhrasebook 2012-03-05 09:46:05 +00:00
virk.shafqat
2ffa5f70da refinements 2012-03-05 09:33:23 +00:00
hallgren
a5a82556af Update home page and download page for GF 3.3.3 release 2012-03-03 11:53:10 +00:00
kr.angelov
4d1b0859d0 libpgf: preliminary version for the statistical ranking. we use naive statistical model with random weight for the meta variables. 2012-03-02 19:25:01 +00:00
hallgren
3790733e30 GF download page: Windows binary package added 2012-03-02 17:54:38 +00:00
kr.angelov
58b6bbd242 libpgf: simple optimization in the implementation for heaps 2012-03-02 17:43:46 +00:00
hallgren
5983268552 GF 3.3.3 download page: initial set of binary packages added 2012-03-02 16:12:51 +00:00
peter.ljunglof
5625e5f8f7 added HTML readme file to fracasbank 2012-03-02 14:57:44 +00:00
hallgren
0da74edb95 Fix release notes typos 2012-03-02 13:43:02 +00:00
hallgren
4300847117 Updated GF 3.3.3 release notes 2012-03-02 13:33:37 +00:00
hallgren
21c278f28f gf.cabal: update version number to 3.3.3
but I am not tagging it yet, there is still time for some changes
2012-03-02 10:57:08 +00:00
hallgren
0ed816c118 Update doc/gf-help-full.txt
* echo help -full -t2t | gf -run >doc/gf-help-full.txt
* Insert 3 empty lines first in the file.
2012-03-01 19:39:42 +00:00
hallgren
7f4038e0a8 gfse: bug fix
Fix a problem opening grammars created before grammar extension was introduced.
2012-03-01 18:11:58 +00:00
hallgren
1100f87925 WebSetup.hs: avoid ? wildcards because of odd behaviour under Win32
There is some discussion here: http://www.xxcopy.com/xxcopy18.htm
2012-03-01 16:33:32 +00:00
hallgren
4a1fe5012f doc-phrasebook.txt: update link to minibar doc 2012-03-01 15:53:22 +00:00
hallgren
53d57cdb5b doc-phrasebook.txt: update hyperlinks
Link to www.grammaticalframework.org instead of code.haskell.org/gf.
2012-03-01 15:45:05 +00:00
hallgren
24a650be63 GF home page minor style update 2012-03-01 14:51:16 +00:00
hallgren
f34b052847 Setup.hs: include Hindi and Thai by default in RGL builds 2012-03-01 14:25:41 +00:00
hallgren
2d58947d92 WebSetup.hs: use </> instead of '/' for Win32 compatibility 2012-03-01 14:21:47 +00:00
hallgren
145d8c149f Rename FoodsThai.gf back to FoodsTha.gf
so that it is included by default when building Foods.pgf for gf -server mode.
2012-03-01 13:53:48 +00:00
kr.angelov
2775faad7a libpgf: an API for building heaps from buffers in gu/seq.c 2012-02-29 18:51:21 +00:00
hallgren
b727e676b4 gfse & minibar: minor style adjustments 2012-02-29 17:37:13 +00:00
hallgren
01404e579c gf -server: update start page, add links to some documentation 2012-02-29 17:05:45 +00:00
hallgren
9a6619e819 gfse: add missing file sort.js to the repository 2012-02-29 16:36:28 +00:00
hallgren
f573d52b43 PGFService.hs bug fix: pattern match failure in doParse
doParse was missing a branch for PGF.ParseIncomplete.
Also introduced the operator .= to simply the code that builds JSON objects.
2012-02-29 16:21:34 +00:00
hallgren
4052767790 Updated GF 3.3.3 release notes 2012-02-28 17:47:10 +00:00
kr.angelov
e31c883075 libpgf: the first prototype for the robust parser 2012-02-29 14:43:08 +00:00
kr.angelov
b054549082 libpgf: the choice object should remember integers instead of single bytes 2012-02-29 13:41:59 +00:00
hallgren
6f42f58f71 gfse: Translation Quiz integration
Also moved the translation quiz from demos/TransQuiz to src/www/TransQuiz so
that it will be installed by 'cabal install' along with the other files that
are installed for use by gf -server mode.
2012-02-28 17:24:34 +00:00
hallgren
c1c1a73dc3 gf -server mode: JSONP support for grammar lists
Needed by the translation quiz.
2012-02-28 17:20:59 +00:00
kr.angelov
5fa1418194 libpgf: another fix in the parser debugger 2012-02-28 16:37:12 +00:00
hallgren
6a5de9e7d8 GF 3.3.3 release notes: mention the new RGL languages 2012-02-28 15:53:08 +00:00
aarne
69f84defb0 bug fix in AppPredefined: don't compare values that contain variables. this should be checked even more generally. 2012-02-28 15:13:32 +00:00
hallgren
c2cf5c48e5 Updates for the GF 3.3.3 download page 2012-02-28 14:51:09 +00:00
kr.angelov
4ddf24429b libpgf: the time measurement in pgf-translate should be made after pgf_parse_result for more accurate timing 2012-02-28 13:14:24 +00:00
kr.angelov
dcbeb63849 libpgf: fix in the parser debugger 2012-02-28 13:12:38 +00:00
john.j.camilleri
b0ac2fa9ff Updated 3.3.3 release doc
Added link to GFEP page.
2012-02-28 12:56:31 +00:00
hallgren
40148db81d Adding release notes and download page for version 3.3.3
Feel free to add to the release notes!
2012-02-28 11:02:08 +00:00
kr.angelov
eb4bfb008e buf fix in the compiler for HOAS 2012-02-28 08:10:47 +00:00
aarne
d560a2aa79 fixed Italian loro->li 2012-02-28 07:55:38 +00:00
hallgren
4441c957ea gfse: recognize Predef categories Int, Float and String
but don't show them in the startcat menu.
2012-02-27 17:18:05 +00:00
hallgren
c41974422f gfse: text mode improvements
+ Preserve the startcat flag.
+ Preserve judgement order when possible (GF's parser does not preserve order
  and does not record exact source locations, only line numbers)
2012-02-27 16:50:06 +00:00
kr.angelov
686fcca9a4 libpgf: pretty printing for expressions with metavaraibles 2012-02-27 13:50:35 +00:00
hallgren
7145436a0d Phrasebook feedback: hide feedback submitted by Googlebot 2012-02-27 13:18:03 +00:00
aarne
dcea5b554f Hin and Snd in MiniGrammar demo 2012-02-25 09:53:09 +00:00
hallgren
03f3baeba3 gfse: text mode editing: accept grammars with printname judgements
But printname judgements are ignored for now.
Also fixed an UTF-8 encoding bug when parsing uploaded grammars in gf -server
mode.
2012-02-24 17:12:38 +00:00
hallgren
92aa961205 GF home page: News: Hindi, Sindhi 2012-02-24 15:42:57 +00:00
hallgren
f81e1586f5 gfse: text mode tweaks 2012-02-24 15:16:37 +00:00
kr.angelov
667ca8e5f7 libpgf: fix in pgf_read_into_map 2012-02-24 15:15:07 +00:00
kr.angelov
1d239ab567 libpgf: simple fix in the grammar printer and the reader 2012-02-24 13:52:21 +00:00
aarne
aa7668ef75 the Predef function eqVal to compare equality of parameter values 2012-02-24 10:00:27 +00:00
hallgren
be76d44b8f demos/index.html: some demos are not new anymore 2012-02-23 16:48:34 +00:00
hallgren
e30eeb4918 src/server/ContentService.hs: fix compilaton problem 2012-02-23 16:46:21 +00:00
virk.shafqat
4ba9944663 hindi-resource-grammar 2012-02-23 13:36:50 +00:00
kr.angelov
b99fa6aa9a libpgf: now we have both complete bottom up index for robust parsing and fast lexical lookup from the same index 2012-02-22 21:27:54 +00:00
hallgren
26d5bcd394 gfse: layout fix
Style options inteded for some buttons used in example-based editing was
unintensionally applied to some other OK/Cancel buttons as well.
2012-02-22 16:45:46 +00:00
hallgren
9ebc423004 gfse: experimental support for editing concrete syntax in text mode 2012-02-22 16:30:42 +00:00
hallgren
2312b3c9c9 gfse: some refactoring 2012-02-22 14:12:31 +00:00
kr.angelov
42410f80d2 libpgf: two small fixes in the parser debugger 2012-02-22 14:06:49 +00:00
kr.angelov
786bf883b7 libpgf: the map curr_lindefs must be allocated from a temporary pool 2012-02-22 08:49:08 +00:00
kr.angelov
7ddd0d5f3e libpgf: added index for fast lexicon lookup. Still not perfect 2012-02-21 21:17:50 +00:00
kr.angelov
a178608f37 utils/pgf-translate now reports the parsing time 2012-02-21 20:17:18 +00:00
kr.angelov
e725b10d66 fixes in the script for the conversion of PennTreebank 2012-02-21 17:26:04 +00:00
hallgren
2eddc116e6 gfse: edit abstract syntax in text mode with instant syntax error reporting
This is an experimental feature. It requires server support for parsing and is
thus not available while offline, unlike most other editing functionality.
2012-02-21 16:58:18 +00:00
virk.shafqat
5403e31264 sindhipatch 2012-02-21 09:02:42 +00:00
hallgren
94685d184d GF.Inra.UseIO: add instance Functor IOE, add method fail to instance Monad IOE 2012-02-20 17:26:49 +00:00
normundsg
e25ee8e2fb Latvian: 1) added some extra things that are used by the Attempto grammar; 2) added notpresent tags; 3) compiles with Setup.hs and lib/src/Make.hs 2012-02-20 02:42:07 +00:00
kr.angelov
a55a224dce libpgf: now the debugging mode for the parser is available only with compilation option. 2012-02-18 19:30:16 +00:00
kr.angelov
5259be92e3 libpgf: remove the now redundant field extra_ccats in PgfConcr 2012-02-18 16:25:53 +00:00
kr.angelov
47e5e8c966 libpgf: now the linearization index is created during the grammar loading which also makes the types PgfLzr and PgfParser redundant. 2012-02-18 16:22:40 +00:00
kr.angelov
aed7cc429a libpgf: simplify the loading of PgfCncCat 2012-02-17 14:26:08 +00:00
kr.angelov
4f8ad8c23f libpgf: added printer.c 2012-02-17 14:11:29 +00:00
hallgren
21f657a64a gfse: when uploading/compiling a grammar, automatically upload inherited grammars as well 2012-02-17 16:07:28 +00:00
hallgren
f446649550 gfse: bug fix
...in the function that computes the transitive closure of the grammar
inheritance relation.
2012-02-16 17:05:12 +00:00
hallgren
d98f63af51 gfse: you can now remove grammars from the list of inherited grammars 2012-02-16 16:44:44 +00:00
hallgren
03aca7421b gfse: style sheet fixes 2012-02-16 16:17:34 +00:00
hallgren
7cac11c8e8 gfse: more work on grammar extension
Grammars can now inherit from several other grammars.
Hovering over a catagory name in a function type in the abstract syntax
shows where the category was inherited from.
2012-02-15 17:35:09 +00:00
hallgren
1a64606819 minibar_translations.js: bug fix
Two methods used the global variable p instead of declaring a local variable p.
This caused the function p (that constructs HTML <p> elements) in support.js
to suddenly be redefined as a number.
2012-02-15 17:23:52 +00:00
hallgren
f9e4032c3e gfse: make categories from inherited grammars available in the startcat menu 2012-02-14 17:18:06 +00:00
hallgren
f0702e6942 gfse: bug fix in grammar download from cloud 2012-02-13 19:23:52 +00:00
hallgren
aa753c8b4c Recording changes in automatically generated HTML files on the server 2012-02-13 18:19:51 +00:00
hallgren
b01d7c341c gfse & minibar: small fixes 2012-02-13 18:11:46 +00:00
hallgren
ec09dd6804 minibar: fix problems with the feedback form 2012-02-13 17:58:06 +00:00
hallgren
b126a28cc5 gfse: better integration of the minibar
The minibar is now displayed inside the editor, intead of on a separate page.
This makes the context clearer and makes it more obiovous how to return to the
editor.
2012-02-13 17:31:39 +00:00
hallgren
4c0e8c18c7 minibar: bug fix: accidental reference to global variable "server" 2012-02-13 17:25:37 +00:00
hallgren
fc897a909a gfse: added a button to go directly from the editor to the minibar
If there is an error in the grammar, the error message is shown below the
grammar instead.
Also: GFServer.hs now returns compiler output in a JSON structure instead of
as a HTML page.
2012-02-13 15:24:05 +00:00
hallgren
73827b9bf7 gfse: stay on the same page when compiling grammars
The link to the minibar (or compiler errors) are now shown below the grammar
on the same page. If you go to the minibar, you only have to press the back
button once to get back to the editor.
Also some output formatting changes in GFServer.hs.
2012-02-10 17:26:02 +00:00
hallgren
6b29296060 gfse&minibar: select the right grammar in minibar when invoked from gfse
The grammar that the user is currently working is now the one shown initially
in minibar, instead of the first grammar in alphabetical order.
Also GFServer.hs now removes absolute paths to the grammar files on the server in error messages from GF returned to to gfse.
2012-02-10 15:24:59 +00:00
hallgren
d8958ed68d gfse: bug fix: syntax check in concrete syntax wasn't working
In newer versions of GF the shell says "syntax error" instead of "parse error".
2012-02-10 13:38:24 +00:00
hallgren
9dfab3d187 gfse: initial support for module extension
There is a new way to create a new grammar based on an existing grammar:
by extending it. (It is also possible to clone an existing grammar, a before.)
2012-02-09 18:00:36 +00:00
hallgren
7787c5d725 gfse: document the representation of GF grammars used by the editor. 2012-02-07 17:27:23 +00:00
john.j.camilleri
85f4264317 Updated GFEP page 2012-02-08 13:28:17 +00:00
john.j.camilleri
9122d44ed6 Udpated GFEP readme 2012-02-02 08:55:31 +00:00
hallgren
597ffd3003 gf -server: better error message for requests with unsupported HTTP methods 2012-02-01 17:34:23 +00:00
hallgren
3cbad333ad gf -server: fix bug that caused '+' to be converted to ' ' in uploaded grammars
Fixed buggy workaround for bug in httpd-shed function queryToArguments.
2012-02-01 17:17:46 +00:00
hallgren
debb9da44d GF home page: adding an experimental site search box 2012-01-31 14:18:00 +00:00
john.j.camilleri
43a372a6cf Updated GFEP page 2012-01-31 14:08:41 +00:00
peter.ljunglof
582c6cc92f Added the FraCaS Treebank to the examples 2012-01-27 22:56:14 +00:00
kr.angelov
6f0795d8a3 libpgf: switch to using callbacks and lazy prediction in the parser. this reduce the parsing time from 11 sec down to 3 sec. 2012-01-26 12:32:26 +00:00
kr.angelov
a2414bc625 libpgf: use a temporal pool for allocating the arrays in the continuation map of the parser 2012-01-26 09:03:08 +00:00
kr.angelov
8256750599 libpgf: fix a warning in reader.c 2012-01-26 08:58:23 +00:00
kr.angelov
ecb5e9f23a libpgf: fix in string.h 2012-01-26 08:58:03 +00:00
kr.angelov
58de345f99 libpgf: few fixes to make the loading of grammars with def rules possible 2012-01-24 14:47:11 +00:00
kr.angelov
acc4f352af libpgf: extra_ccat is now redundant and was removed 2012-01-23 19:47:08 +00:00
kr.angelov
4f289698f0 libpgf: forgot to add utils/pgf-print.c 2012-01-23 16:34:02 +00:00
kr.angelov
1af48d34ec pgf-translate: add \n at the end of two error messages 2012-01-23 15:51:37 +00:00
kr.angelov
5ccd75c8b9 libpgf: debugging framework for the parser 2012-01-23 15:49:29 +00:00
kr.angelov
fcd2c2905e libpgf: the concrete categories were allocated from the temporary pool 2012-01-23 13:43:17 +00:00
kr.angelov
4e4881dba5 libpgf: printing of literals and flags 2012-01-23 10:17:20 +00:00
kr.angelov
7fcaa81858 libpgf: move the lindefs field from PgfCncCat to PgfCCat. display the list in the grammar printout 2012-01-23 09:46:45 +00:00
kr.angelov
28bce1cdc0 added an API for printing the PGF to human readable format 2012-01-21 10:27:55 +00:00
kr.angelov
d164ddfbe1 fix the crash in the reader when there aren't any productions per category. 2012-01-21 10:25:43 +00:00
kr.angelov
2eee382a62 initial import of the C runtime 2012-01-20 13:41:10 +00:00
john.j.camilleri
b972835712 Updated instructions for gedit editor mode 2012-01-23 12:57:08 +00:00
john.j.camilleri
cfcea38e8d Updated GFEP readme
Added details about updates sites in installation instructions
2012-01-23 08:53:28 +00:00
john.j.camilleri
116fff5808 Updated GFEP readme 2012-01-20 15:35:09 +00:00
john.j.camilleri
3a7d9adc46 Updated GFEP readme 2012-01-18 13:47:23 +00:00
john.j.camilleri
4c77d313ab Removed GFEP releases from darcs
They will still be available online at the same URL, but it was becoming messy having the jars under version control.
2012-01-18 13:31:40 +00:00
Nikita Frolov
2ffbf3c567 Another batch of small Russian Phrasebook fixes 2012-01-16 22:31:02 +00:00
aarne
85d777e068 sorted the list of funs and cats in GrammatToPGF to get the predef categories in proper place and get gr, ai, gt work properly 2012-01-14 17:06:54 +00:00
john.j.camilleri
0cda1b3a9a Updated GFEP page 2012-01-11 14:07:36 +00:00
john.j.camilleri
4f65a874d7 GFEP Release 1.2.3 2012-01-11 12:57:45 +00:00
john.j.camilleri
e78b193270 GFEP Release 1.2.3 2012-01-11 12:54:13 +00:00
john.j.camilleri
130f9f88cd Updated GFEP readme 2012-01-11 08:02:47 +00:00
kr.angelov
796dd530ee the translation script from the Penn format to GF RGL is now in examples/PennTreebank 2012-01-10 19:36:28 +00:00
john.j.camilleri
1732254a1b Added new GFEP release 2012-01-10 16:26:27 +00:00
john.j.camilleri
fba58ab302 Cleared old GFEP release 2012-01-10 16:24:49 +00:00
john.j.camilleri
58b935a9dc GFEP Release 1.2.2 2012-01-09 07:59:21 +00:00
Nick Frolov
8e2c1823ed A Russian dictionary
A Russian dictionary generated from a wordlist created by the FreeLing
project. The accompanying converter can be used to convert other wordlists in
EAGLES format to GF grammars.
2011-12-31 02:36:24 +00:00
aarne
ba451d203a Latvian and Thai on language list in GF index 2011-12-29 08:50:33 +00:00
john.j.camilleri
5b8035abc2 Removed GFEP section from GF Editor Modes page 2011-12-28 14:01:24 +00:00
jordi.saludes
fb0f46be4a Fixing 'linearize' in py-bindings/test.py 2011-12-22 21:29:45 +00:00
jordi.saludes
bff947f44f Changed 'lin' method name to 'linearize' (py-bindings). 2011-12-08 13:08:36 +00:00
jordi.saludes
093ba41fa3 Added an example file as documentation for py-bindings. 2011-12-08 13:05:23 +00:00
jordi.saludes
75c6aa83cd Added parser completions to py-bindings. 2011-12-07 18:09:33 +00:00
kr.angelov
bb6905e36f the parser now use nub instead of nubsort which means that the abstract syntax trees will be returned lazily 2011-12-19 13:10:33 +00:00
hallgren
15678a0fce gf -server[=port]
You can now specify which port the HTTP server should run on in server mode.
The default is 41296.
2011-12-14 15:28:27 +00:00
hallgren
02bcfa2098 gf-bib.bib: added EACL 2009 and ACL 2010 entries from gf-bibliography.t2t 2011-12-14 15:26:05 +00:00
hallgren
6dd649d5ff gf-bibliography.t2t: fixed a typo 2011-12-14 15:25:09 +00:00
hallgren
7f5d121a9a gf -server mode improvements
+ Avoid looping if it is not possible to create a new server directory.
+ Work on FastCGI support using the direct-fastcgi package (commented out
  for now because of buggy behavior).
2011-12-14 15:11:13 +00:00
aarne
d0cfd4ea3a script for making phrasebook with Thai pronunciation 2011-12-09 18:49:03 +00:00
aarne
8691f51ae3 last-minute fixes for Thai Phrasebook 2011-12-09 13:05:41 +00:00
aarne
15168563a2 adjustments in Phrasebook and synopsis 2011-12-08 14:04:42 +00:00
kr.angelov
7c9bbd844b Now graphvizAbstractTree suppress the visualization of implicit arguments. 2011-12-08 09:18:38 +00:00
aarne
d8b68c85b6 Nui's corrections to Synopsis examples and Phrasebook; a logo for Thai 2011-12-06 21:36:38 +00:00
kr.angelov
1160244271 Phrasebook is updated for Bulgarian 2011-12-06 13:54:25 +00:00
aarne
5f4ac04804 diverse RGL and Phrasebook fixes, and a corrected Synopsis 2011-12-05 15:25:06 +00:00
aarne
8f05c404c5 adjustments in Thai pronunciation 2011-12-05 09:36:26 +00:00
aarne
2a0c611486 Male/Female greetings distinguished in Phrasebook 2011-12-04 18:09:02 +00:00
aarne
ea01e7181e typos in WordsTha corrected 2011-12-04 09:49:06 +00:00
aarne
cf9dd6c9fe make thaidroid: a Phrasebook with Thai pronunciation 2011-12-03 12:08:19 +00:00
kr.angelov
c52f05ed46 The typechecker is still unfinished but at least it can typecheck the English resource grammar 2011-12-02 12:33:26 +00:00
aarne
9baa13476a how far in PhrasebookTha 2011-12-02 11:15:02 +00:00
kr.angelov
e6135d963e missing cases in GF.Grammar.Binary 2011-12-02 09:58:18 +00:00
aarne
40d03d6578 occupations in Phrasebook Eng,Fin,Swe,Tha 2011-12-02 09:50:16 +00:00
aarne
a32f9664f6 Nui's grammar error reports implemented in PhrasebookTha 2011-12-01 21:58:42 +00:00
aarne
0814c07791 PhrasebookTha corrections from Nui 2011-12-01 14:50:23 +00:00
aarne
db62687ab1 imperatives added to Phrasebook (familiar,polite,plural,positive,negative) 2011-12-01 12:51:40 +00:00
aarne
7086eea9f5 workaround in -opt flag to compile Phrasebook 2011-12-01 10:35:54 +00:00
aarne
0d726c3f90 new pronoun exceptions carried out in Romance and Finnish in Phrasebook 2011-12-01 09:20:34 +00:00
kr.angelov
b859edee38 Hopefully complete Value type and a little bit more on computations. 2011-11-30 20:56:31 +00:00
aarne
33f1eeb7d1 splits in Phrasebook Kind category: Drink and Plur; some new words in Tha,Eng,Fin,Swe 2011-11-30 20:24:23 +00:00
aarne
69d54030c0 complete Thai, new Disambiguation items (Romance pronouns to be revisited) in Phrasebook 2011-11-30 15:00:06 +00:00
aarne
d2b99a0607 added RGL-functorial concepts to Phrasebook 2011-11-30 10:54:05 +00:00
aarne
cac8f22129 Thai phrasebook vocabulary from Nui 2011-11-30 10:53:33 +00:00
kr.angelov
7863b21c1a more stuff in the new type checker 2011-11-30 14:55:52 +00:00
kr.angelov
f9af731c9c fix the compilation after the patch for the new type checker 2011-11-29 18:45:51 +00:00
hallgren
d9f8ed932f Also recording gf-bibliography.html...
...although I think in general it is a bad idea to keep automatically generated
files in the source repository.
2011-11-29 15:38:01 +00:00
hallgren
97f47f3d3d gf-bibliography.t2t: add links to PDFs for ACL 2010 and EACL 2011 papers 2011-11-29 15:36:14 +00:00
kr.angelov
fffc5f2507 Sketch of the new type checker for the concrete syntax. Enabled only with -new-comp 2011-11-29 12:12:51 +00:00
john.j.camilleri
1dd5af7729 Fixed GFEP release 2011-11-29 09:06:43 +00:00
john.j.camilleri
2c7a88afbe New GFEP release 2011-11-29 09:01:27 +00:00
john.j.camilleri
638b69904c Removed GFEP beta updatesite 2011-11-29 09:00:15 +00:00
john.j.camilleri
9e3f8036b2 Updated GFEP index page 2011-11-29 08:59:25 +00:00
hallgren
70d292d83b gfse: fix bugs and typos 2011-11-28 16:36:51 +00:00
aarne
8fffefd268 some Thai corrections from Nui 2011-11-28 14:34:59 +00:00
john.j.camilleri
a241786a19 Updated GFEP 1.2.0 release 2011-11-25 11:11:30 +00:00
john.j.camilleri
2c9f3914b2 Re-added GFEP 1.2.0 release 2011-11-25 10:59:40 +00:00
john.j.camilleri
38ec4d35f6 Cleaned up GFEP releases 2011-11-25 10:57:46 +00:00
aarne
68c1f430fb added Rus to Phrasebook compilation script 2011-11-24 22:00:57 +00:00
Nick Frolov
dc121c6bd3 Symbolic and Nound fixes for Russian 2011-11-24 16:13:08 +00:00
kr.angelov
c05be64838 now if some module is compiled with -no-pmcfg then the PMCFG code is generated at the end during the linking phase. Now the default compilation of the libraries with cabal is with -no-pmcfg. 2011-11-24 14:23:04 +00:00
john.j.camilleri
62d1320cfe Updated GFEP readme 2011-11-24 14:03:04 +00:00
john.j.camilleri
fd91f5221e Added GFEP release for Thu, 24 Nov 2011 14:52:50 +0100 2011-11-24 13:52:50 +00:00
john.j.camilleri
ac8a85e9ba Updated GFEP readme 2011-11-24 13:52:05 +00:00
kr.angelov
26d61354dd make addSequencesB(V) strict. Otherwise we get stack overflow when compiling LangFre 2011-11-22 20:31:58 +00:00
aarne
1f731df285 options for no-pmcfg compilation in lib/src/Make.hs (for library developers, rather than users); adding Thai to some demo and documentation 2011-11-21 15:30:55 +00:00
hallgren
d66110f84e gfse: example-based: some usability improvements
Instead of showing nothing, show disabled buttons and some expanatory text to
provide guidance for users getting started with example-based grammar writing.
2011-11-21 15:24:29 +00:00
hallgren
e9e029d39f example-based: bug fix: apply UTF-8 decoding to CGI inputs
You can now use words with ÅÄÖ when writing Swedish grammars by example...
2011-11-21 15:15:49 +00:00
aarne
ccf16172cf extending PhrasebookTha; one third left 2011-11-20 19:07:36 +00:00
aarne
1c15afdcfc thword used in FoodsThai 2011-11-20 15:09:59 +00:00
john.j.camilleri
3dd078b7e2 Added GFEP release for Fri, 18 Nov 2011 16:31:16 +0100 2011-11-18 15:31:16 +00:00
john.j.camilleri
76bd781a84 Updated GFEP index.html 2011-11-18 15:30:34 +00:00
john.j.camilleri
47f99a88cc Changed GFEP screenshot 2011-11-18 15:21:48 +00:00
kr.angelov
3d973adb33 rebuildModule should do location globalization too 2011-11-17 22:11:56 +00:00
kr.angelov
4f95b5656b bugfix in the overload resolution. It was accidentally introduced as part of the per module PMCFG generation 2011-11-17 21:36:45 +00:00
john.j.camilleri
d84cb09e48 Added GFEP release for Thu, 17 Nov 2011 15:23:02 +0100 2011-11-17 14:23:02 +00:00
john.j.camilleri
95f022ddeb Updated GFEP index page 2011-11-17 14:15:52 +00:00
john.j.camilleri
e87584fc68 Added new GFEP screenshot for web 2011-11-17 13:40:35 +00:00
john.j.camilleri
0840b88649 Added GFEP release for Wed, 16 Nov 2011 12:44:59 +0100 2011-11-16 11:44:59 +00:00
aarne
9f4660832d changed FoodsTha to FoodsThai (to mark it as unstable) 2011-11-16 10:51:06 +00:00
kr.angelov
04fdb41927 fix in the versioning of the .gfo files 2011-11-15 19:46:02 +00:00
kr.angelov
a2626e24dd now we store version number in every .gfo file. If the file is compiled with different compiler then we simply recompile it. 2011-11-15 19:12:22 +00:00
kr.angelov
8a10aa5cf9 now the pretty printer in GF has a new mode called Internal. This is the most detailed mode and it can print even things that are not in the GF syntax. For example PMCFG snippets and indirections. 2011-11-15 15:55:45 +00:00
kr.angelov
59e098a440 Now the errors messages from GF.Compile.Update also follow the new format 2011-11-15 15:33:52 +00:00
john.j.camilleri
30aafddab1 Added ResMlt to foods 2011-11-15 14:54:28 +00:00
kr.angelov
b1a82e8e8a the indirections in the .gf-tags files now point directly to the origin of the corresponding indentifiers 2011-11-15 14:30:31 +00:00
kr.angelov
61c16f2eb2 more structured format for errors and warnings from the compiler 2011-11-15 13:33:44 +00:00
kr.angelov
8a7aa15c57 bugfix in the new PGF generation 2011-11-14 16:27:59 +00:00
kr.angelov
43fc9f462a remove the -output-file option 2011-11-14 16:10:13 +00:00
kr.angelov
7be8566f35 the new design for -tags 2011-11-14 16:08:56 +00:00
john.j.camilleri
7f9e245c36 Updated readme 2011-11-14 11:23:17 +00:00
john.j.camilleri
5afaa04bc8 Updated GFEP index page 2011-11-14 10:46:46 +00:00
kr.angelov
416d231c5e Now PMCFG is compiled per module and at the end we only link it. The new compilation schema is few times faster. 2011-11-10 14:09:41 +00:00
john.j.camilleri
4baa44a933 Fixed lock field warnings in FoodsMlt 2011-11-10 12:03:15 +00:00
kr.angelov
b25ec6ae89 remove few obsolete options from GF.Infra.Options 2011-11-10 09:02:46 +00:00
aarne
d090d831e9 additions to new-gf-bib.bib 2011-11-08 16:07:00 +00:00
aarne
0c5a7a4efd FoodsTha, still to be checked 2011-11-08 16:06:40 +00:00
hallgren
e614c46221 Download page: add a not about the directory binaries are installed in on Mac OS X with recent versions of cabal. 2011-11-09 08:37:51 +00:00
john.j.camilleri
92e6beed7f Added separate link for GFEP 2011-11-08 07:48:16 +00:00
aarne
1218d48beb PhrasebookTha: Swadesh-definable words added 2011-11-07 21:21:14 +00:00
aarne
e454f155ed Thai phrasebook now compiles with RGL (but is incomplete) 2011-11-07 15:46:55 +00:00
ramona.enache
543ed4f926 added Ramona's articles to doc file 2011-11-07 13:13:08 +00:00
aarne
b5de84a98a Thai phrasebook started 2011-11-06 23:26:56 +00:00
aarne
6b0a929197 Thai phrasebook started: Greetings OK 2011-11-06 21:13:09 +00:00
kr.angelov
0d04d56241 qualified names in the tags file 2011-11-04 16:20:41 +00:00
john.j.camilleri
98741f3fbf Added GFEP release for Fri, 04 Nov 2011 11:33:35 +0100 2011-11-04 10:33:35 +00:00
john.j.camilleri
aef76e2e27 Updated /eclipse index file 2011-11-04 10:31:24 +00:00
hallgren
312e602dfe gfse: supply information about what's defined in the exampe language to the server functions for example-based grammar writing 2011-11-02 16:54:22 +00:00
hallgren
5856098f2f gfse: example-based: remove target language from the example language menu 2011-11-02 16:13:30 +00:00
john.j.camilleri
1d411cad87 Added GFEP release for Wed, 02 Nov 2011 17:34:00 +0100 2011-11-02 16:34:00 +00:00
kr.angelov
734c66710e merge GF.Infra.Modules and GF.Grammar.Grammar. This is a preparation for the separate PGF building 2011-11-02 13:57:11 +00:00
kr.angelov
5fe49ed9f7 Now the compiler maintains more precise information for the source locations of the different definitions. There is a --tags option which generates a list of all identifiers with their source locations. 2011-11-02 11:44:59 +00:00
hallgren
42af63414f gfse: grammar sharing: bug fixes and win32 support
win32 support is untested
2011-11-01 17:45:57 +00:00
hallgren
9ba8db6e0a gfse: documentation update 2011-11-01 17:45:01 +00:00
hallgren
f8665c7213 Remove configuration flag cclazy 2011-11-01 13:45:12 +00:00
hallgren
9ebb9c98b8 Translation Quiz: add copyright notices in source files
As suggested by Elnaz.
2011-11-01 13:22:24 +00:00
Nick Frolov
5b7736e860 Fixed a typo in the shell online help 2011-11-01 11:22:13 +00:00
Nick Frolov
54ae626666 Improvements of Russian Phrasebook that do not rely on Participles and Numerals 2011-10-18 15:16:58 +00:00
john.j.camilleri
eaaa6808a9 Added GFEP release for Mon, 31 Oct 2011 15:46:01 +0100 2011-10-31 14:46:01 +00:00
john.j.camilleri
8f11e1ca7b Added GFEP release for Mon, 31 Oct 2011 13:04:08 +0100 2011-10-31 12:04:08 +00:00
aarne
cd5deea02f new version of gf-bib.bib 2011-10-31 10:53:29 +00:00
john.j.camilleri
ee24e01feb Updated html page 2011-10-28 14:32:00 +00:00
john.j.camilleri
dd1cac8c38 New release 2011-10-28 12:20:11 +00:00
aarne
e90e2e11e1 a few more entries to gf-bibliography 2011-10-28 09:07:54 +00:00
hallgren
1a563b5b7e One more binary package for the GF 3.3 release 2011-10-27 19:44:27 +00:00
hallgren
a7144932f4 Adding more binary packages for the GF 3.3 release 2011-10-27 16:59:29 +00:00
john.j.camilleri
c146a10c65 Updated release 2011-10-27 11:29:49 +00:00
john.j.camilleri
87a975696a Updated release with filters working again 2011-10-27 11:07:00 +00:00
aarne
509a9d497a publications: added Burden & Heldal 2011-10-27 08:34:56 +00:00
john.j.camilleri
7a71fc38b5 Added release folder 2011-10-27 07:24:23 +00:00
kr.angelov
8a263781d0 add Windows binary 2011-10-26 13:30:42 +00:00
john.j.camilleri
c42e4a8486 Added new release 2011-10-26 11:56:18 +00:00
hallgren
5543a045b5 Fix some more typos and clean up 3.2.9 download page 2011-10-25 21:01:39 +00:00
hallgren
3ab5b9d177 Fix typo on GF 3.3 download page 2011-10-25 20:50:15 +00:00
hallgren
76f5ce2383 Adding two binary packages to the GF 3.3 download page 2011-10-25 20:44:55 +00:00
hallgren
c72708fbfb GF 3.3 news item on the GF home page 2011-10-25 20:21:02 +00:00
hallgren
1b2de503bf Move GF 3.3 download page in place 2011-10-25 18:58:02 +00:00
hallgren
c4ee13abac Recording an alternative version of look in Compute/ConcreteLazy.hs
Commented out, causes problems in the greek example.
2011-10-25 18:50:07 +00:00
hallgren
b949892e43 GF 3.3 tentative release date is 2011-10-27 2011-10-25 18:47:09 +00:00
hallgren
a8185fd997 Preparations for release of GF 3.3
+ Changing version numbers and dates here and there.
+ Simplify build-binary-dist.sh since pgf-http need not be built anymore.
+ Use--gf-lib-path to make the sample grammars for minibar compile even if GF
  is not installed.
2011-10-25 18:25:49 +00:00
aarne
5fd8299805 qualification with real module name accepted, as in GF refman 2011-10-25 14:03:27 +00:00
hallgren
9c506ff641 Preparing for release of GF 3.3
+ Release notes in download/release-3.3.t2t
+ New download page in download/index-3.3.t2t (to be renamed to index.t2t)
2011-10-25 13:10:10 +00:00
hallgren
87f86f7342 TODO list for example-based grammar writing and grammar editor functionality 2011-10-25 12:47:51 +00:00
aarne
fdcd7c7486 items to release notes on my changes 2011-10-25 07:44:57 +00:00
hallgren
6da9744c6b download/release-3.2.t2t: make room for GF 3.2.10 release notes 2011-10-24 18:25:37 +00:00
hallgren
113c6f6746 gf-quickstart.html: describe gf -server instead of pgf-http 2011-10-24 18:13:04 +00:00
aarne
7372da3d7f use associativity to force more precompilation of pre expressions 2011-10-24 12:52:20 +00:00
hallgren
442dc95071 Work on example-based grammar writing
+ Preparations to support more target languages. Tested with Swedish.
+ Don't enable example-based editing if there is less that two concrete
  languages in the grammar.
+ Don't show the "By example" button until the required lincat has been defined.
+ Remember the chosen language for examples.
2011-10-21 15:43:57 +00:00
hallgren
ed451653bd Introduce an explicit error value in the Term type
This makes it easier to treat run-time errors (e.g. caused by calls to
Predef.error) in a way that is more typical for a lazy functional language.
2011-10-20 14:36:30 +00:00
hallgren
e5accc0d8d Some experiments with PSeq (left commented out) 2011-10-20 14:25:31 +00:00
hallgren
ef4fac9d82 Compute/ConcreteLazy.hs: no need to reverse when looking up labels in records 2011-10-20 14:19:33 +00:00
hallgren
d8d60adb15 AppPredefined.hs: more readable notation for the types of primitives 2011-10-20 14:17:37 +00:00
hallgren
3dbdc56669 phrasebook/Makefile: use 'gf -run' to make missing.txt 2011-10-20 13:58:46 +00:00
hallgren
a9f4d42652 Setup.hs: less verbose output during the compilation of the RGL
Only show the full gf command line if an error occurs.
2011-10-20 13:36:42 +00:00
hallgren
6c5ee3d666 PGF.hs: Add LANGUAGE BangPatterns to make GHC 7.2 happy
Also remove oddly named function forExample (topological sorting) from export
list.
2011-10-20 13:21:28 +00:00
hallgren
b8124730b1 pgf-http setup: update path to minibar 2011-10-18 15:35:30 +00:00
hallgren
26b8df5cf5 minibar: adding a start category menu
+ The start category menu can be turned off by passing the option
  {startcat_menu:false} when starting the minibar.
+ Documentation updates.
2011-10-18 15:21:49 +00:00
hallgren
d63724ed50 minibar: add a button to show some grammar info 2011-10-18 14:34:00 +00:00
hallgren
4c3cc9f176 pgf service: include the start category in grammar info 2011-10-18 14:31:40 +00:00
john.j.camilleri
d9f7697f7a Added Eclipse contents 2011-10-17 16:01:07 +00:00
john.j.camilleri
83533afd5f Added link for GFEP 2011-10-17 15:40:18 +00:00
hallgren
d4ee4a6133 example-based: use random generation for the examples 2011-10-17 13:51:25 +00:00
hallgren
c0becec2bd Bug fix in setup for gf -server mode
Use the command "dist/build/gf/gf" instead of "gf" to compile the sample
grammars for the minibar, to avoid failing if gf is installed in a directory
which is not in the $PATH.
2011-10-14 19:34:55 +00:00
hallgren
bd7cb1ab41 Show version & configuration info when gf -server starts 2011-10-12 19:00:42 +00:00
hallgren
8266df8f58 Bug fixes for gf -server mode and setup 2011-10-12 18:27:46 +00:00
hallgren
44d1a5a9f7 Improvements of "gf -server" mode and related setup
"gf -server" mode now contains everything needed to run the minibar and
the grammar editor (including example-based grammar writing).

The Setup.hs script installs the required files where gf -server can find them.
These files have been moved to a new directory: src/www.

The separate server program pgf-http is now obsolete.
2011-10-12 17:03:54 +00:00
hallgren
0aba45560d More work on support for gfse in "gf -server" mode 2011-10-11 19:17:47 +00:00
hallgren
ef079ff939 gfse: make it workw ith "gf -server" cloud services 2011-10-10 19:49:17 +00:00
hallgren
b138844695 Add cloud services needed by gfse to "gf -server" mode 2011-10-10 19:46:57 +00:00
hallgren
693b807cb5 minibar/support.js: added function encodeArgs. 2011-10-10 17:40:53 +00:00
hallgren
04d2dc757c More functionality in "gf -server" mode
"gf -server" mode now includes PGF service and the services to support
example-based grammar writing. (But gf -server is not quite ready to replace
pgf-http yet...) 

Also bumped GF version number to 3.2.10-darcs
2011-10-10 16:16:16 +00:00
hallgren
5b980dcb93 gfse: documentation tweaks 2011-10-07 12:14:30 +00:00
hallgren
5f0d407968 example-based grammar writing: avoid a problem by returning Nothing instead of calling error 2011-10-04 10:04:01 +00:00
aarne
4af079006b gf-bibliography.html with Thomas' corrected links 2011-10-03 15:42:12 +00:00
aarne
44ecbd11bc updated gf-biblio with cse instead of cs 2011-10-03 15:39:39 +00:00
hallgren
c04d8ccd80 corrected links in gf-biblio 2011-10-03 15:36:27 +00:00
aarne
ddc34a2162 new items in gf-bibliography.t2t 2011-10-03 15:18:59 +00:00
hallgren
7402ff2429 gfse: browser compatibility fixes 2011-10-03 12:28:49 +00:00
hallgren
dfbf4f9e14 gfse: references to the GF book in keyword tool tips and style tweaks for example-based grammar editing 2011-10-03 08:21:35 +00:00
hallgren
bb585fef2c Example-based grammar writing: fix problems caused by the use of exprToAPI
The editor needs to keep track of both the raw term and the nice term returned
by exprToAPI. (Manually constructed linearization rules will now have the
raw term and can not be tested.)

Also replace metavariables in generalized terms with the apropriate parameter
from the linearization rule.

Also fix communication problems caused by inconsistent use of show/read vs
showExpr/readExpr.
2011-09-29 15:19:03 +00:00
hallgren
ad725d8531 gfse: about.html updates 2011-09-28 15:26:34 +00:00
hallgren
6142258302 gfse: mention example-based grammar writing in about.html 2011-09-27 19:18:50 +00:00
hallgren
cdef284b2b exb: call exprToAPI to create nicer linearization functions 2011-09-27 19:17:53 +00:00
hallgren
b9b353795b Server-side support for example-based grammar writing 2011-09-27 18:59:54 +00:00
hallgren
667b37f418 gfse: work in progress on support for example-based grammar writing 2011-09-27 18:40:09 +00:00
hallgren
64beaae58f Update the shell reference manual 2011-09-27 13:20:37 +00:00
aarne
a83b6bea62 don't count app nodes in term size 2011-09-26 13:56:39 +00:00
aarne
ff4929e25e Query/small packaged 2011-09-26 06:56:36 +00:00
aarne
1a3a26563b generalized show_dependencies to take a list of constants as its argument 2011-09-25 08:43:23 +00:00
aarne
0c2f20d04d structured examples in help into pairs (command,explanation) 2011-09-25 08:42:27 +00:00
aarne
780d9ef528 bug fixes in code size analysis 2011-09-24 08:20:58 +00:00
kr.angelov
bb599029c9 change the precedence for the left argument of -> 2011-09-22 16:24:02 +00:00
aarne
6db0c74c2f the sd -size command now shows the size of all code needed for defining an oper 2011-09-22 12:11:03 +00:00
aarne
baa9bcd9d0 documented the ss command 2011-09-22 07:40:19 +00:00
hallgren
ea04171fc6 Update 19 broken links in the GF bibliography
Most of the broken link were due to the move from www.cs.chalmers.se was to
www.cse.chalmers.se in 2010.
2011-09-21 16:37:20 +00:00
aarne
bd22b935de statistics on grammar size in terms of constructors 2011-09-21 13:24:59 +00:00
kr.angelov
89fb9a7fdf fix in the proof search. when we start the generation from a template, we must start the refinement from the expression that the typecheker generated 2011-09-21 13:30:09 +00:00
aarne
958e81126d commands ss to show source, and sd to show the dependencies of a constant 2011-09-21 08:12:14 +00:00
aarne
33a42b1c7c module for analysing source grammars 2011-09-20 16:00:56 +00:00
aarne
a2ccf1ce69 command ss to show source (including gfo) in text; to be extended 2011-09-20 14:58:27 +00:00
hallgren
209ec0d7fe Home page news item about editor modes for GF 2011-09-20 12:51:34 +00:00
hallgren
c32a244a3c Created a new page documenting available editor modes for GF
Also adding editing modes for Gedit and Geany contributed by John J. Camilleri.
2011-09-20 12:41:32 +00:00
aarne
a4a1f33cd3 QueryGer added; some bugs to fix 2011-09-20 12:05:07 +00:00
aarne
b08309f236 QueryIta added 2011-09-20 08:54:35 +00:00
aarne
c7384bd432 QueryFre added; a utf8 typo in StructuralFre corrected 2011-09-20 08:08:28 +00:00
aarne
7da592fecc treebank to test Query 2011-09-19 15:39:48 +00:00
aarne
a96e90a4ae QueryFin improved 2011-09-19 14:37:30 +00:00
hallgren
343e852bfe test suite: Don't fail because of the Win32/Unix text file incompatibility. 2011-09-19 13:14:01 +00:00
hallgren
c8c81f77f7 Adding test case for interaction between record subtyping and record extension 2011-09-19 12:43:14 +00:00
hallgren
128cd2f5c0 gfse: add Extra and Lexicon to the list of resource modules that can be opened 2011-09-16 15:13:27 +00:00
ra.monique
bdc77bf0e4 added topological sort module to PGF - to be used in example based grammar writing 2011-09-15 16:32:49 +00:00
hallgren
751fd79763 Add a command name header to the 'help -t2t' output 2011-09-15 18:19:01 +00:00
hallgren
167bc341cb Add the commands to the table of contents in the GF shell reference manual 2011-09-15 11:18:59 +00:00
aarne
10d79ed050 made ps -from_TRANSLIT symmetric to -to_TRANSLIT in the sense that unknown characters are returned as themselves and not as question marks 2011-09-15 10:49:40 +00:00
hallgren
927c8c0678 Include a table of contents in the GF shell reference manual 2011-09-14 20:46:04 +00:00
hallgren
584c31bc62 Separate commands with <hr> instead of <p> in the GF shell reference manual 2011-09-14 20:39:51 +00:00
hallgren
c99ae66061 Omit empty sections in GF shell reference manual 2011-09-14 20:28:21 +00:00
hallgren
642d391d73 Omit empty sections in gf help output 2011-09-14 20:26:22 +00:00
hallgren
ffcddbe571 Use 'help -full -t2t' to generate the GF Shell reference manual 2011-09-14 19:43:59 +00:00
hallgren
570afd870c GF shell command 'help -t2t' outputs help in txt2tags format 2011-09-14 19:40:28 +00:00
hallgren
553474d9dc Adding a link to the GF shell reference manual on the GF home page 2011-09-14 16:24:49 +00:00
aarne
8d05fa5cc7 Donkey: Det and Conj added, as well as negative sentences 2011-09-14 15:56:19 +00:00
hallgren
f2786ca0a0 Adding a GF shell command reference
First, plain text version generated with 'help -full' in the shell.
Introduction taken from the GF book.
2011-09-14 13:15:56 +00:00
hallgren
e36af534bf gfse: added grammar cloning 2011-09-13 15:19:16 +00:00
aarne
d394f76e3d quick fixes in PGF.TypeCheck suggested by Krasimir; to be revisited 2011-09-14 11:29:35 +00:00
aarne
35b92c5109 Donkey: added AP, reported problem with ModCN and polymorphic AP's 2011-09-14 09:29:56 +00:00
aarne
7004770236 rewrote DonkeyEng with RGL and introduced VP category 2011-09-13 19:52:48 +00:00
aarne
604c92bf47 examples on using type theory 2011-09-13 19:09:31 +00:00
aarne
a92ceb2e35 added examples/typetheory 2011-09-13 14:34:36 +00:00
hallgren
8488c1d06e Added news item about the GF 3.2.9 snapshot on the home page 2011-09-12 15:48:22 +00:00
hallgren
5f52a670e5 Mention the 3.2.9 snapshot release on the download page 2011-09-12 15:38:13 +00:00
hallgren
74ae2cc737 Record old changes in gf-reference.html
even though this file is automatically generated from gf-reference.t2t.
2011-09-12 15:35:00 +00:00
hallgren
39602f75fe Record the added link to the JPGF Android Tutorial on home page 2011-09-12 15:32:31 +00:00
hallgren
1748df0df8 Take snapshot, version 3.2.9 2011-09-12 14:42:54 +00:00
hallgren
38a352b3d0 gf.cabal: add Tested-With field 2011-09-12 14:33:15 +00:00
hallgren
c8501547bf Don't make noexpand the default with -fcclazy
This reverts the previous change. Not preprocessing opers turns out to make a
difference in what needs to be mentioned in restricted inheritance/imports.
2011-09-09 16:17:33 +00:00
aarne
0bc4513ae5 utf8 in gf-book index 2011-09-09 15:00:50 +00:00
aarne
10bf327fee slides and UK order of gf-book 2011-09-09 14:57:28 +00:00
hallgren
d74b4cbde8 Make -fcclazy (the new faster lazy compute_concrete) the default. Bump version number to 3.2.9 2011-09-09 13:54:19 +00:00
hallgren
312c13c2d8 Make noexpand the default optimization package when configuring with -fcclazy 2011-09-09 13:50:38 +00:00
hallgren
42ea96a5ca Remove unused function computeConcreteRec.
This also allows the parameter rec to be removed from function computeTermOpt.
(The change is made in GF.Compile.Compute.ConcreteLazy, but not in 
GF.Compile.Compute.ConcreteStrict.)
2011-09-09 12:25:27 +00:00
hallgren
8098f79941 GF.Grammar.Macros: simplify composOp and composSafeOp 2011-09-07 17:11:52 +00:00
hallgren
e223d3bdb9 Make the -fcclazy configuration option visible in the build info in the GF Shell welcome message 2011-09-05 15:20:39 +00:00
hallgren
875df01dc6 Add lazy version of GF.Compile.Compute.Concrete
This patch adds GF.Compile.Compute.ConcreteLazy, which replaces the Err monad
with the Identity monad. While the Err monad makes the interpreter
(hyper)strict, the Identity monad let's the interpreter inherit Haskell's
laziness.  This can give big speedups: from 50s to 1s in one example,
from ~4 minutes to ~2 minutes for the RGL.

This is still experimental and might be buggy, so it is off by default.
You can turn it on by configuring with the -fcclazy flag, e.g.

	cabal configure -fcclazy

Let me know if anything breaks.
2011-09-01 16:39:41 +00:00
hallgren
bfe4b0b2a4 GF.Grammar.*: generalized the type of some functions that can not fail from the Err monad to arbitrary monads 2011-09-01 16:35:53 +00:00
hallgren
314abe733b GF.Compile.Coding: cleaner code
Refine function codeTerm into codeTerm, codeLTerm and codeLTerms.
2011-08-31 13:55:49 +00:00
hallgren
d180dadf08 GF.Infra.Modules: minor tweaks
Still keeping the modules both in a list and in a finite map. The overhead is
smaller than I initially thought.
2011-08-31 11:18:16 +00:00
hallgren
b743abb375 GF.Infra.Modules: restore module dependency order invariant
It is needed by greatestResource (and similar functions, presumably).
So keep both the list and the finite map of modules. This slows down some
things, but the compilation of PhrasebookFin.pgf benefits from it.
To be continued...
2011-08-30 20:20:45 +00:00
hallgren
ba10b5b0ca GF.Infra.Modules: keep the modules of a grammar in a finite map instead of a list
This speeds up the compilation of PhrasebookFin.pgf by 12%, mosly by speeding
up calls to lookupModule in calls from lookupParamValues, in calls
from allParamValues.

The invariant "modules are stored in dependency order" is no longer respected!
But the type MGrammar is now abstract, making it easier to maintain this or
other invariants in the future.
2011-08-30 18:54:50 +00:00
kr.angelov
2001788b02 few more fixes in the NLG grammar 2011-08-30 17:29:13 +00:00
hallgren
fe2fad8f8d GF.Grammar.Lookup: added function lookupQIdentInfo
+ Avoids some code duplication by combinging lookupModule and lookupIdentInfo.
+ Also removed lookupIdentInfo from export list, since it is not used anywhere
  else.
2011-08-30 14:53:11 +00:00
hallgren
a0c785d5d0 PatternMatch.hs: commented out suspicious unused function varsOfPatt 2011-08-30 12:13:50 +00:00
hallgren
125ae7a3d3 GrammarToPGF.hs: comment out unused imports 2011-08-30 12:02:32 +00:00
kr.angelov
a29a4408a8 added quantifier ambiguity in the NLG example 2011-08-30 15:23:59 +00:00
kr.angelov
c70df9200c added example for NLG from logical formula. See examples/nlg 2011-08-30 14:58:16 +00:00
kr.angelov
4215fc31bf bugfixes in the typechecker and the tree generator 2011-08-30 11:24:59 +00:00
kr.angelov
41a60772c7 bugfix: allow higher-order variables in the linearization 2011-08-30 09:22:44 +00:00
aarne
380011eb7d skip spaces before closing parenthesis in PGF.Expr.pFactor 2011-08-29 12:03:45 +00:00
aarne
769121788a import command now gives priority to new abstract syntax, and discards the old concretes if they are for the old abstract; the new priority is implemented in PGF.Data.unionPGF 2011-08-28 10:35:55 +00:00
kr.angelov
5339aa8074 fix SUMO after the update in DictEng 2011-08-23 15:05:04 +00:00
hallgren
623c72ca1d pgf-http: fix a bug that caused "+" to be treaded as " " in PGF service requests URLs.
This was a bug in my workaround for a bug in the httpd-shed package. It
made it impossible to use the glue token "&+" for Turkish input in the minibar,
for example.
2011-08-25 16:58:17 +00:00
aarne
6757ab2b41 reload command in shell 2011-08-25 15:58:38 +00:00
hallgren
1fccece30c pgf-service: apply the OpenMath LaTeX function only when linearizing to a
concrete language whose name ends with LaTeX.
This change also avoids duplicating output and, in addition to the linearize
command, applies the transfer also when using the linearizeAll command.
2011-08-24 09:37:55 +00:00
hallgren
ba03db58a4 pgf-service: add Jordis transfer function for OpenMath LaTeX output 2011-08-23 16:25:00 +00:00
hallgren
0880abdc04 Someone added a link to the Android page 2011-08-22 21:01:59 +00:00
hallgren
c5086bda7c minibar: documentation update 2011-08-22 17:55:47 +00:00
hallgren
d45b9edcd8 minibar: quick fix to allow literals to be entered.
If you press Enter, the current word will be accepted, even if there are no
matching completions.
(You can now use names of people when constructing sentences in the Letter
grammar, for example.)
2011-08-22 17:03:47 +00:00
aarne
3afefb0ac9 commented Compute/Concrete with explanations 2011-08-22 17:08:07 +00:00
hallgren
cf9f1057ed pgf service: external service hook: always format the output as a JSON string 2011-08-22 16:10:56 +00:00
hallgren
d8d80693db pgf service: added a hook for external services
This is really reinventing CGI, people should learn how to write CGI scripts
instead...
TODO: better handling of temporary files
2011-08-22 15:34:44 +00:00
aarne
36b9d55ed6 some adjective fixes in FoodsGle 2011-08-22 14:43:58 +00:00
aarne
7b4663067e the from preposition in various Phrasebooks 2011-08-22 14:40:57 +00:00
jordi.saludes
baee60d6cc Correct 'Hotel' in Cat Phrasebook 2011-08-22 13:07:34 +00:00
hallgren
f19c496b83 minibar: documentation fixes 2011-08-21 21:35:14 +00:00
hallgren
6c8c0cdc24 minibar: bug fix for "Try Google Translate" button 2011-08-19 13:56:12 +00:00
aarne
3a776d25b3 FoodsGle by Michal Mechura 2011-08-18 19:53:04 +00:00
aarne
095f296747 FoodsCze by Katerina Bohmova 2011-08-18 19:51:28 +00:00
hallgren
9c8fbd74fe gfse: fix an issue with Webkit browers
For lin and lincats with empty RHSs, there was nothing to point to to make the
edit button (the "%" button) appear in browsers based on Webkit
(Safari, Chrome).
2011-08-17 15:41:57 +00:00
hallgren
4cad2daa29 minibar: adding pgf_offline.js
This file exports the same PGF runtime interface as pgf_online.js but calls
the hs2js translation of the PGF runtime library (which is not included
in darcs).
2011-08-16 16:29:51 +00:00
hallgren
37f8db4432 demos: just recording some recent changes to the index page 2011-08-16 15:41:31 +00:00
aarne
69d0fecb7e Hebrew mini resource by Dana Dannells 2011-08-14 16:49:19 +00:00
hallgren
065178a64d gf.cabal: bump version to 3.2.8-darcs
This is just to make it easier to tell who has the latest version at the 
summer school. There has been some bug fixes in gf itself and some significant
additions to the RGL since 3.2 was released.

Also explicitly require Alex 2.x. The recently released Alex 3.0 has backwards
incompatible changes and does not work. GF/Grammar/Lexer.x should probably
be modified to support both Alex 2.x and Alex 3.0...
2011-08-12 14:02:24 +00:00
hallgren
b2512234dd minibar: documentation and API work 2011-08-11 16:28:49 +00:00
hallgren
19d84b6de0 minibar: some functions were in the wrong file 2011-08-11 14:56:34 +00:00
hallgren
91cc4de1a2 minibar: more documentation (in minibar-api.html) 2011-08-09 15:57:40 +00:00
hallgren
d4638f54ba minibar: refactoring for improved modularity
Two smaller objects have been factored out from the Minibar object:
Input and Translations. These have been placed in two separate files:
minibar_input.js and minibar_translations.js. Some common auxiliary functions
have also been moved to a separate file: minibar_support.js
2011-08-08 17:28:24 +00:00
hallgren
e50731c511 minibar: resolve conflict 2011-08-08 14:08:55 +00:00
hallgren
ab8ec58e08 minibar: improve pgf_online.js
pgf_online.js has been simplified and generalized to support the full
GF Web Service API. The changes are backwards incompatible, unfortunately.
The documentation and minibar.js have been updated accordingly.
2011-08-03 15:21:38 +00:00
hallgren
a0ec59ccda minibar: small code and documentation tweaks 2011-08-03 14:24:47 +00:00
hallgren
8c620229e1 minibar: recording old configuration changes 2011-08-08 14:04:51 +00:00
hallgren
8cf7671e07 gfse: added links to download PGF files for user's grammars 2011-08-01 15:01:14 +00:00
hallgren
a918bcaf68 gfse: add missing file share.html to darcs
Also fix bug in share.html by adding cloud.js to the list of loaded JavaScript
files.
2011-08-01 14:27:29 +00:00
hallgren
b58fc79908 gfse: some correctness checks for concrete syntax
The editor now calls the GF server to check the syntax of expressions that
are part of concrete syntax (except for parameter types).
This is currently done by using the cc command of the GF shell, which puts
some unnecessary restricitons on operation definitions...
2011-07-29 15:44:19 +00:00
hallgren
7c6f6110eb gfse: refactoring
Factor out functions that interface to the old cloud service (upload.cgi) 
from editor.js into cloud.js. Merge changes from editor2.js into editor.js and
factor out functions that interface to gf -server into clouds2.js.
2011-07-29 13:45:37 +00:00
hallgren
9d547fbdca gfse: about: added a note that each grammar has a unique identity independent of its name 2011-07-26 15:03:33 +00:00
hallgren
0f7743992b gfse: various small improvements 2011-07-25 19:21:46 +00:00
aarne
848373e29e GenIP, GenRP in Extra and any_Quant in ExtraEng 2011-07-21 08:25:04 +00:00
Nick Frolov
29e40b92e1 The stub of Russian Phrasebook is tweaked to start giving sane output 2011-07-07 17:10:14 +00:00
hallgren
6c751da6e8 gfse: new section "Grammars in the cloud" in about.html 2011-07-07 16:59:37 +00:00
hallgren
c4f1fbbc9a gfse: grammars in the cloud, still primitve, but good enough to be installed on the server, I think 2011-07-07 16:57:59 +00:00
hallgren
c7fffd861b gfse: grammars in the cloud, work in progress
Cloud merging: when sharing grammars between two devices that previously each
had separate grammar directoies on the server, clean up one of the directories
and make it a symbolic link to the other.
2011-07-07 13:30:56 +00:00
aarne
f224ead86b Nepali corrected in Synopsis; Nepali and Persian added to main page 2011-07-07 12:42:28 +00:00
hallgren
db4753aa2d gfse: grammars in the cloud, work in progress 2011-07-06 16:55:42 +00:00
hallgren
25ae9b2dc4 gfse: initial support for grammars in the cloud
This lets the user access the same set of grammars from multiple devices.

Sharing grammars between multiple users is possible but discouraged at the
moment. There is no version handling, so concurrent editing of the same grammar
by different users might result in one user overwriting changes made by
another user. (The same goes for cuncurrent editing on multiple devices by
a single user, of course.)
2011-06-08 15:29:50 +00:00
adam.slaski
25a9efb13c phrasebook polish updated 2011-06-23 12:44:53 +00:00
hallgren
49c27436f5 minibar support.js: add function ajax_http_post for posting FormData 2011-06-21 16:10:44 +00:00
hallgren
e1385da050 gf-server: make pgf-service work the Apache mod_fastcgi
pgf-service now appears to works with Apache mod_fastcgi (under Mac OS X) in
addition to lighttpd.

One difference appears to be that while lighttpd passes the name of the PGF
file in the SCRIPT_FILENAME variable, Apache passes it in PATH_TRANSLATED.
But perhaps this depends on exactly how the fastcgi service is configured.
The following is what I added to the Apache configuration file to test this:

	<Directory /Library/WebServer/Documents/fcgi-bin>
	  SetHandler fastcgi-script
	  Options +ExecCGI
	</Directory>
	Action pgf-service /fcgi-bin/pgf-service
	AddHandler pgf-service .pgf
2011-06-21 15:49:31 +00:00
hallgren
549cc324d7 gf-server: enable -rtsopts when compiling with ghc>=7.0 2011-06-21 15:45:13 +00:00
hallgren
739e4caef3 gf-server.cabal: a separate flag for the content service
* Use cabal install -ffastcgi to compile the fastcgi server.
  * Use cabal install -fcontent to compile the content service (off by default,
    currently broken)
  * Use both flag to compile both.
2011-06-21 15:38:57 +00:00
hallgren
55a20c6d05 gfse: fix a problem in browsers where "class" is a reserved keyword 2011-05-07 17:36:49 +00:00
aarne
11af624122 updated information on GF book 2011-06-20 20:52:23 +00:00
virk.shafqat
fabd2fe192 refinementNepali-11-06-20 2011-06-20 11:24:22 +00:00
aarne
098af279e7 allow empty lines in transliteration files 2011-06-14 11:49:10 +00:00
aarne
a3924abece Predef functions toUpper, toLower, isUpper 2011-06-02 16:10:46 +00:00
aarne
d9ccb26c98 "Urd in Phrasebook Makefile; correct form of adj Spa.spanish_A" 2011-06-02 10:30:32 +00:00
aarne
ce312050bf ported the change in English NPCase and Polarity to SUMO 2011-06-02 08:30:06 +00:00
aarne
889db78207 patches in Spanish adjectives by Inari 2011-06-02 07:24:20 +00:00
jordi.saludes
fbdb3126c2 Fixed A's in Cat phrasebook nationalities 2011-06-01 15:50:21 +00:00
virk.shafqat
86d2e676bc refinementsTextUrd-11-05-19 2011-05-19 15:57:12 +00:00
virk.shafqat
54bf16d848 refinements-2011-05-19 2011-05-19 15:19:15 +00:00
virk.shafqat
d101d16cae refinementsUrdPhrasebook-2011-05-13 2011-05-13 21:51:16 +00:00
aarne
c3669542d1 addition to Urdu phrasebook 2011-05-13 11:14:47 +00:00
virk.shafqat
d024a7665d refinementsUrdPhrbook-2011-05-12 2011-05-12 16:24:00 +00:00
virk.shafqat
b7e638e534 refinementsUrdPnb-2011-05-11 2011-05-11 00:11:52 +00:00
virk.shafqat
d106bdd54a refinements-2011-05-10 2011-05-10 14:33:08 +00:00
hallgren
c207175e98 gfse: you can now add concrete syntax for arbitrary languages
Before, you had to pick a language from a list of supported languages, but now
you can also pick Other and change the language code afterwards.
2011-05-06 15:24:45 +00:00
aarne
a01d18dd33 Urdu phrasebook (not complete) 2011-05-06 12:29:46 +00:00
aarne
f158fad6f8 fixed problems in persian transliteration pointed out by Elnaz 2011-05-06 12:11:45 +00:00
virk.shafqat
4fa3130a32 refinements-Pnb-2011-04-30 2011-04-30 18:11:48 +00:00
aarne
4ec34bdbb6 transliteration via configuration file: ps -to=file or ps -from=file 2011-05-02 14:53:46 +00:00
hallgren
fd0fb48493 Ctrl-C shouldn't terminate the GF shell
This quick fix should make Ctrl-C in the GF shell behave more like it does in
other shells: even if no command is running, Ctrl-C now just gives you a new
prompt instead of terminating the shell.
2011-04-20 14:30:49 +00:00
hallgren
a53558aac0 GFI.hs: some refactoring for readability
Also some minor changes in how Ctrl-C is handled and how CPU time is measured.
2011-04-15 15:05:44 +00:00
aarne
1eb0fcba11 added book in the documentation 2011-04-15 12:07:59 +00:00
hallgren
99388d116d gfse: use "gf -server" mode instead of upload.cgi
Work in progress on making the online grammar editor use the new "gf -server"
mode instead of the old upload.cgi script. A first benefit is that the
editor now calls the server to check the syntax of lin & lincat definitions.
(But the links to minibar/gfshell/quiz are not available at the moment.)
2011-04-13 15:30:42 +00:00
hallgren
0a27aaf1e6 Added a preliminary "gf -server" mode.
The command "gf -server" now starts a simple HTTP server on port 41295,
providing a simple web API to the GF compiler. It currently support the
follwing operations:

  * creating new temporary directories for grammar uploads,
  * uploading grammars files for use in the GF shell,
  * executing GF shell commands, and
  * accessing static files.

This means that GF now depends on some additional networking related packages,
but they should be available and easy to install on all platforms. There is
also a new configuration flag "server" in gf.cabal, so GF will be compiled
without support for server mode if the extra packages are unavailable.

Note that running gf -server while connected to the internet can be a security
risk. To prevent unauthorized access to the rest of the system, it is
advisable to run the server in GF_RESTRICTED mode and as a user with suitably
restricted file permissions.
2011-04-13 14:58:01 +00:00
hallgren
8fed629a3e Show configuration options as part of build info
The GF shell welcome message will now include something like

	This is GF version 3.2.1-darcs. 
	Built on darwin/i386 with ghc-7.0, flags: interrupt

where a list of enabled configuration flags are included on the last line.

This is implemented in GF.Infra.BuildInfo by consulting the CPP macros
defined by the respective option in gf.cabal. For this to work,
GF.Infra.BuildInfo obviously has to be updated when new flags are added to
gf.cabal or if the CPP macros are renamed.

(Also, I suspect that if you reconfigure with different flags and rebuild GF
without cleaning first, the BuildInfo module will not be recompiled,
resulting in a misleading welcome message...)
2011-04-13 14:45:21 +00:00
hallgren
d066619b8f GF.Infra.UseIO: add functions readBinaryFile & writeBinaryFile 2011-04-13 14:44:18 +00:00
hallgren
6b8fa745e2 minibar: fix typo 2011-04-11 13:03:46 +00:00
hallgren
ca335793de minibar: small documentation updates and corrections 2011-04-11 13:00:52 +00:00
hallgren
4d4a58e54a GF shell restricted mode: found one more writeFile that should be restricted 2011-04-08 13:20:50 +00:00
hallgren
00a08fb4fb avoid warning from ghc-7.0
Warning: -fglasgow-exts is deprecated: Use individual extensions instead
2011-04-06 13:57:19 +00:00
hallgren
b4e3e8c0fa avoid warning from ghc-7.0
Warning: -fglasgow-exts is deprecated: Use individual extensions instead
2011-04-06 13:43:29 +00:00
aarne
75e401d1a7 generate Eq instance for GADT 2011-04-06 12:27:31 +00:00
aarne
7067b1c992 fixed the printing of predefined and list categories in haskell=gadt 2011-04-06 07:45:35 +00:00
hallgren
b1c2c27ae6 GFI.hs: refactoring to add a function for executing a single GF shell command.
The intention is to use the new function to implement a web service API to
the GF shell.
2011-04-04 20:06:55 +00:00
hallgren
1b08ca8a61 Add build info to the GF shell welcome message 2011-04-04 19:52:07 +00:00
hallgren
d1b95cef99 gfse: somewhat simplified configuration/installation 2011-03-28 15:04:43 +00:00
hallgren
06a29cb573 gfse: added an alternate style sheet with the MOLTO color scheme 2011-03-28 14:46:15 +00:00
hallgren
17f3b456ce minibar: don't force focus to the typed input field after every word
On touch-based devices, the on-screen keyboard kept popping up after every word,
which was very annoying if you were entering a sentence by tapping on the
magnets.
2011-03-22 15:17:48 +00:00
hallgren
5c7ebcc511 minibar: add trailing slash in suggested grammar URLs 2011-03-22 15:12:54 +00:00
gdetrez
9a0889d687 Adding a missing file for the tokenizer... 2011-03-17 16:04:21 +00:00
gdetrez
45ecae4b77 Adding a basic lexicon-based tokenizer and the asociated command in gf shell 2011-02-10 15:00:06 +00:00
gdetrez
d7ae73f1c7 Adding an option to the gf compiler to add an index to pgf files
This is gonna be used by the android library to skip unused part of a
pgf file
2010-12-11 16:36:30 +00:00
aarne
a59df6b495 started a grammar for grammatical terms, covering the cats of the RGL 2011-03-14 18:48:08 +00:00
aarne
b9ebd48a2c smaller query grammars for MOLTO KRI 2011-03-13 19:49:41 +00:00
aarne
7361ddea45 make it possible to override opers defined in an interface by syntax 'instance Foo of Bar - [f,g,h]' 2011-03-12 11:24:14 +00:00
aarne
3ddc29f2dc make later flags take priority over earlier ones in PGF generation 2011-03-12 11:22:21 +00:00
aarne
1599ce4ba9 generalized pt -transfer so that it goes into subtrees (naive implementation in TreeOperations; using PGF.Expr.match would be better); example given in 'h pt' 2011-03-12 10:20:54 +00:00
hallgren
b9bfb3ccec gfse: documentation fixes, links to MOLTO meeting slides and compiler API document 2011-03-09 11:11:47 +00:00
hallgren
d30a3b182b gfse: add a link from demo page to the editor 2011-03-09 10:05:53 +00:00
krasimir
18519c20fd fix the grammar browser in the editor 2011-03-08 12:32:51 +00:00
krasimir
42ad2d5e95 the user can now upload their own grammars in the editor 2011-03-07 21:05:29 +00:00
hallgren
62c85f1bb6 gfse: create a new concrete syntax by copying an existing one
When adding a new concrete syntax to a grammar, the currently open concrete
syntax will be copied. If the abstract syntax is currently open, the new
concrete syntax will start out empty.
2011-03-07 17:52:15 +00:00
hallgren
cfb5f6eb7e gfse: link back to the editor from the upload page 2011-03-07 16:05:55 +00:00
hallgren
629919667b gfse: minor layout/formatting variation 2011-03-06 10:19:17 +00:00
aarne
f32307b39d added composOp generation to haskell-gadt, and an example in examples/gadt-transfer 2011-03-05 22:25:03 +00:00
aarne
d9b5d3ed4d switched the upper and lower parts of lexc entries to their standard order 2011-03-04 17:25:53 +00:00
aarne
14f11bb2b9 revived GADT generation 2011-03-04 17:05:40 +00:00
aarne
88a0790f32 fixed a variable refreshing bug in the compiler 2011-03-04 16:44:30 +00:00
hallgren
914ee33396 minibar: add icon for word alignment button 2011-03-03 19:19:47 +00:00
hallgren
527e000a12 minibar: add a button to display word alignment 2011-03-03 19:18:09 +00:00
hallgren
2c1feccd17 GF shell restricted mode
By setting the environment variable GF_RESTRICTED before starting GF, the shell
will be run in restricted mode. This will prevent the GF shell from starting
arbitrary system commands (most uses of System.Cmd.system are blocked) and
writing arbitrary files (most commands that use writeFile et al are blocked).

Restricted mode is intended minimize the potential security risks involved
in allowing public access to the GF shell over the internet. It should be used
in conjuction with system level protection mechanisms (e.g. file permissions)
to make sure that a publicly acessible GF shell does not give access to parts
of the system that should not be publicly accessible.
2011-03-03 15:42:57 +00:00
hallgren
b190d30fad gf.cabal: bump version number, add source repository info
I changed the version number to 3.2.1-darcs.
I think the version number of the current version from darcs should always
include the "-darcs" suffix (or "-current" perhaps?). The suffix should be
removed only momentarily when making an official release.
2011-03-03 15:24:43 +00:00
aarne
f8c4903285 overloaded opers included in sorting of judgements 2011-03-03 15:10:31 +00:00
aarne
f32091cd53 print lexicon in Xerox LEXC format: pg -lexc 2011-03-03 08:31:15 +00:00
aarne
8e3674600c corrected help for l command 2011-03-01 16:15:20 +00:00
hallgren
e06e587de1 demos/index.html: minibar is now available on the standard port
Minibar was at http://www.grammaticalframework.org:41296/minibar/minibar.html
but now also at http://www.grammaticalframework.org/demos/minibar/minibar.html
which means it is accessible behind firewalls that block requests to
nonstandard ports.
2011-03-01 15:02:13 +00:00
hallgren
6c60b086cf demo/indx.html: record translation quiz entry 2011-03-01 14:58:51 +00:00
hallgren
45b59b0e7e minibar/support.js: recognize relative URLs as locations on the same server
This means that the relative grammar directory location in the default
configuration will result in AJAX requests rather than the less efficient
JSONP requests.
2011-03-01 14:47:20 +00:00
hallgren
a01704fd3e minibar: make the feedback form work in the generic minibar
It is still disabled by default, since some manual configuraiton of
feedback.cgi is required.
2011-03-01 13:46:00 +00:00
hallgren
758e2a031d gfse: fix missing startcat flag bug + documentation updates 2011-02-28 16:47:25 +00:00
hallgren
790e086a54 gfse: fix persmission problem in upload.cgi 2011-02-28 15:46:42 +00:00
hallgren
a4c82e51a0 gfse: include a -path flag to find rgl modules 2011-02-28 15:45:55 +00:00
hallgren
1cae23fce7 gfse: support for opening RGL modules 2011-02-28 14:18:20 +00:00
hallgren
a9287e83af gfse: minor documentation and style improvements 2011-02-28 12:41:05 +00:00
aarne
0dfbc9b730 the command show_operations to inspect opers in scope 2011-02-28 13:31:04 +00:00
aarne
66f95c2cb7 removed message showing what modules are read unless in verbose mode 2011-02-26 10:25:09 +00:00
aarne
445a3aafeb Predef.error surfaces as error message in compilation and cc command 2011-02-25 17:01:10 +00:00
aarne
77b02544fb simple grammar for dates 2011-02-25 15:44:25 +00:00
aarne
390566b17e command ga moved to option 'aw -giza' 2011-02-25 12:55:36 +00:00
aarne
c51c011dda FoodsNep by Dinesh Simk 2011-02-24 14:05:16 +00:00
hallgren
8b76047cda gfse: allow definitions to be reordered by drad-and-drop 2011-02-22 16:04:49 +00:00
hallgren
27f4ad15e3 gfse: fix typos 2011-02-18 14:51:06 +00:00
hallgren
a74a0ae980 gfse: document that grammars can be uploaded and tested in the GF shell, the minibar and the translation quiz 2011-02-18 14:47:20 +00:00
hallgren
e0030daaa7 gfse: updated screen shots 2011-02-18 14:46:18 +00:00
hallgren
173a5e3db2 gfse: support for linking to the translation quiz 2011-02-18 11:44:05 +00:00
hallgren
ac41fe547f translation quiz: always show the grammar menu 2011-02-18 11:52:08 +00:00
hallgren
c2c8f34288 translation quiz: a small change to make easy to select an alternate grammar directory 2011-02-18 11:51:41 +00:00
hallgren
8dd2a1ddc0 gfse: some small fixes
+ 'make install' to copy all required files to the server
+ configuration options and error checks in upload.cgi
2011-02-17 17:35:22 +00:00
hallgren
c1f0d57210 Adding the prototype GF editor for simple multilingual grammars 2011-02-17 14:43:41 +00:00
hallgren
41d37dd353 Adding the prototype GF editor for simple multilingual grammars 2011-02-17 14:42:16 +00:00
hallgren
cc2f9d012c Adding the prototype GF editor for simple multilingual grammars 2011-02-17 14:38:46 +00:00
aarne
c6825f38df example/Discourse for English too 2011-02-09 22:57:56 +00:00
aarne
805c12c49a factored DiscourseFin to 4+5 constructors 2011-02-09 17:11:45 +00:00
aarne
9c68dbcdb1 more general discourse particles in Finnish 2011-02-09 16:42:15 +00:00
aarne
9aeb51b4a5 experimenting with discourse particles in DiscourseFin 2011-02-08 15:49:47 +00:00
aarne
3c82593fdd examples/discourse on Finnish discourse particles and their translations 2011-02-08 12:30:13 +00:00
hallgren
12ad869c69 Download page: added Mac .pkg from Jordi Saludes 2011-02-07 12:20:02 +00:00
aarne
7445e56387 a simple clitic analysis command 'ca' 2011-02-06 16:19:24 +00:00
aarne
878fefc6f5 removed some nonsense-producing variants from Query 2011-01-31 10:03:59 +00:00
aarne
3f0b55b00b new Foods grammars: Fre by Hissu Hyvärinen and Spa by Maarit Koponen 2011-01-31 08:25:28 +00:00
aarne
f875fe563a corrections to ancientgreek encoding by Hans Leiss 2011-01-31 08:06:42 +00:00
aarne
b35c29554d started CompilerAPI, still dummy 2011-01-28 15:28:05 +00:00
hallgren
eb21e14991 minibar: a small change to make easy to select an alternate grammar directory 2011-01-27 22:23:15 +00:00
hallgren
76736a6662 Translation Quiz: fix for race condition on page load 2011-01-26 16:21:23 +00:00
hallgren
62d1ea5a34 Translation quiz: improvements from Elnaz 2011-01-25 11:58:49 +00:00
hallgren
5d2b203901 New item. GF is part of the CLT Toolkit 2011-01-22 14:26:15 +00:00
hallgren
991a433b17 Fix broken links in GF Quick Reference 2011-01-22 14:14:00 +00:00
hallgren
4fda9b5b63 News: Phrasedroid on the Android Market 2011-01-18 13:13:02 +00:00
hallgren
e3d390d81d style.css: remove border from linked GF logotypes 2011-01-18 12:59:55 +00:00
hallgren
f8eed920ff Release notes: added a link to documentation of the bracketed string data structure 2011-01-12 13:01:23 +00:00
hallgren
1604a9370a Fixed a couple of release note typos 2011-01-11 16:09:20 +00:00
aarne
e7439d65b0 gf-book web page index and toc 2011-01-11 15:46:43 +00:00
hallgren
276327f7f2 download: added an note that the .deb packages work on both Ubuntu 10.10 and 10.04. 2011-01-11 14:24:17 +00:00
hallgren
5074b28d4c Link back to the start page from the demo and download pages. 2011-01-11 14:22:28 +00:00
hallgren
65c45e181f Reinstated the link to the multilingual wiki demo 2011-01-11 14:07:11 +00:00
hallgren
11d6326fae minibar: update my home page link (cs->cse) 2011-01-11 13:18:19 +00:00
hallgren
7ea1655165 Demos: added a link to the Online syllogism solver 2011-01-11 13:11:08 +00:00
1592 changed files with 230040 additions and 422774 deletions

View File

@@ -1,22 +0,0 @@
-- Use darcs show authors to see the number of patches per person
Aarne Ranta <aarne@chalmers.se>, aarne@cs.chalmers.se, aarne
Björn Bringert <bjorn@bringert.net>, bringert@cs.chalmers.se, bringert
Krasimir Angelov <krasimir@chalmers.se>, kr.angelov@chalmers.se,kr.angelov@gmail.com,kr_angelov@gmail.com
Peter Ljunglöf <peb@ling.gu.se>, peb,peb@cs.chalmers.se
Thomas Hallgren <hallgren@chalmers.se>, hallgren@altocumulus.org
Janna Khegai <janna@cs.chalmer.se>, janna,janna@cs.chalmers.se
Jordi Saludes <jordi.saludes@upc.edu>
Ramona Enache <ramona.enache@chalmers.se>, ra.monique@gmail.com
Hans-Joachim Daniels <hdaniels>
Jean-Philippe Bernardy <bernardy@chalmers.se>
Kevin Kofler <kevin.kofler@chello.at>
Harald Hammarström <harald2>
Olga Caprotti <caprotti@chalmers.se>, olga.caprotti@gmail.com
Adam Slaski <adam.slaski@gmail.com>, Adam Slaski <adam.slaski@gmail.com>
Moisés Salvador Meza Moreno<meza@student.chalmers.se>, 'Moises Meza <meza@student.chalmers.se>'
Ali El Dada <eldada@student.chalmers.se>, 'ali.eldada@gmail.com'
Markus Forsberg <markus>
Server Cimen <e1560697@ceng.metu.edu.tr>
Grégoire Détrez <gdetrez@crans.org>
Ketil Malde <ketil@ii.uib.no>

2
.ghci Normal file
View File

@@ -0,0 +1,2 @@
:set -isrc/compiler -isrc/binary -isrc/runtime/haskell -isrc/server -isrc/example-based -isrc/server/transfer -idist/build/autogen -idist/build
:set -fwarn-unused-imports -optP-DSERVER_MODE -optP-DUSE_INTERRUPT -optP-DCC_LAZY -optP-include -optPdist/build/autogen/cabal_macros.h -odir dist/build/gf/gf-tmp -hidir dist/build/gf/gf-tmp -stubdir dist/build/gf/gf-tmp

64
.gitignore vendored Normal file
View File

@@ -0,0 +1,64 @@
*.class
*.la
*.o
*.lo
*.jar
*.gfo
*.pgf
dist/
src/runtime/c/.libs/
src/runtime/c/Makefile
src/runtime/c/Makefile.in
src/runtime/c/aclocal.m4
src/runtime/c/autom4te.cache/
src/runtime/c/config.h
src/runtime/c/config.h.in
src/runtime/c/config.log
src/runtime/c/config.status
src/runtime/c/configure
src/runtime/c/gu/.deps/
src/runtime/c/gu/.dirstamp
src/runtime/c/libgu.pc
src/runtime/c/libpgf.pc
src/runtime/c/libsg.pc
src/runtime/c/libtool
src/runtime/c/m4/libtool.m4
src/runtime/c/m4/ltoptions.m4
src/runtime/c/m4/ltsugar.m4
src/runtime/c/m4/ltversion.m4
src/runtime/c/m4/lt~obsolete.m4
src/runtime/c/pgf/.deps/
src/runtime/c/pgf/.dirstamp
src/runtime/c/pgf/lightning/asm.h
src/runtime/c/pgf/lightning/core.h
src/runtime/c/pgf/lightning/fp.h
src/runtime/c/pgf/lightning/funcs.h
src/runtime/c/scripts/
src/runtime/c/sg/.deps/
src/runtime/c/sg/.dirstamp
src/runtime/c/stamp-h1
src/runtime/java/.libs/
src/runtime/python/build/
.cabal-sandbox
cabal.sandbox.config
.stack-work
DATA_DIR
stack*.yaml.lock
# Generated documentation (not exhaustive)
demos/index-numbers.html
demos/resourcegrammars.html
demos/translation.html
doc/tutorial/gf-tutorial.html
doc/index.html
doc/gf-bibliography.html
doc/gf-developers.html
doc/gf-editor-modes.html
doc/gf-people.html
doc/gf-refman.html
doc/gf-shell-reference.html
doc/icfp-2012.html
download/*.html
gf-book/index.html
src/www/gf-web-api.html

14
.travis.yml Normal file
View File

@@ -0,0 +1,14 @@
sudo: required
language: c
services:
- docker
before_install:
- docker pull odanoburu/gf-src:3.9
script:
- |
docker run --mount src="$(pwd)",target=/home/gfer,type=bind odanoburu/gf-src:3.9 /bin/bash -c "cd /home/gfer/src/runtime/c &&
autoreconf -i && ./configure && make && make install ; cd /home/gfer ; cabal install -fserver -fc-runtime --extra-lib-dirs='/usr/local/lib'"

19
LICENSE
View File

@@ -8,24 +8,9 @@ other. For this reason the different components have different licenses.
In summary:
- the GF compiler in the folder src/compiler and the PGF Web service in src/server
are under the GNU GENERAL PUBLIC LICENSE.
are under the GNU GENERAL PUBLIC LICENSE.
- the GF runtime in src/runtime is under dual GNU LESSER GENERAL PUBLIC LICENSE
and BSD LICENSE
- the resource grammar library in lib/src is under GNU LESSER GENERAL PUBLIC LICENSE.
However the user have the right to choose any license for any application grammar
derived from the resource grammar by using the grammar API.
- the resource grammar library also includes large coverage lexicons for some languages.
Since these lexicons are derived from external sources they might be under different licenses.
Look at the source file for every lexicon for details. The lexicons that we currently have
are:
lib/src/bulgarian/ DictBul.gf DictBulAbs.gf for Bulgarian
lib/src/english/ DictEng.gf DictEngAbs.gf for English
lib/src/turkish/ DictTur.gf DictTurAbs.gf for Turkish
lib/src/swedish/ DictSwe.gf DictSweAbs.gf for Swedish
- the GF runtime in src/runtime is under dual GNU LESSER GENERAL PUBLIC LICENSE and BSD LICENSE
The rest of this document contains copies of the GPL, LGPL and BSD licenses
which are applicable to the different components of Grammatical Framework

View File

@@ -1,29 +1,53 @@
.PHONY: all build install doc clean sdist
.PHONY: all build install doc clean gf html deb pkg bintar sdist
# This gets the numeric part of the version from the cabal file
VERSION=$(shell sed -ne "s/^version: *\([0-9.]*\).*/\1/p" gf.cabal)
all: build
dist/setup-config: gf.cabal
chmod u+x lib/src/mkPresent
chmod u+x lib/src/mkMinimal
runghc Setup.hs configure
dist/setup-config: gf.cabal Setup.hs WebSetup.hs
cabal configure
build: dist/setup-config
runghc Setup.hs build
cabal build
install:
runghc Setup.hs install
cabal copy
cabal register
doc:
runghc Setup.hs haddock
cabal haddock
clean:
runghc Setup.hs clean
cabal clean
bash bin/clean_html
sdist:
runghc Setup.hs sdist
gf:
runghc Setup.hs build rgl-none
cabal build rgl-none
strip dist/build/gf/gf
html::
bash bin/update_html
bash bin/update_html
# Make a debian package. First add a suitable entry with the correct GF version
# number to the top of debian/changelog.
# (Tested on Ubuntu 15.04. You need to install dpkg-dev & debhelper.)
deb:
dpkg-buildpackage -b -uc
# Make an OS X Installer package
pkg:
FMT=pkg bash bin/build-binary-dist.sh
# Make a binary tar distribution
bintar:
bash bin/build-binary-dist.sh
#sdist:
# cabal sdist
# Make a source tar.gz distribution using git to make sure that everything is included.
# We put the distribution in dist/ so it is removed on `make clean`
sdist:
test -d dist || mkdir dist
git archive --format=tar.gz --output=dist/gf-${VERSION}.tar.gz HEAD

33
README
View File

@@ -1,33 +0,0 @@
DESCRIPTION
The Grammatical Framework (=GF) is a grammar formalism based on type theory.
It consists of
* a special-purpose programming language
* a compiler of the language
* a generic grammar processor
The compiler reads GF grammars from user-provided files, and the
generic grammar processor performs various tasks with the grammars:
* generation
* parsing
* translation
* type checking
* computation
* paraphrasing
* random generation
* syntax editing
GF particularly addresses four aspects of grammars:
* multilinguality (parallel grammars for different languages)
* semantics (semantic conditions of well-formedness, semantic
properties of expressions)
* grammar engineering (modularity, abstractions, libraries)
* embeddability in programs written in other languages (C,C++,
Haskell, Java, JavaScript)
COMPILATION and INSTALLATION of source distribution:
See doc/gf-developers.html for installation instructions.

53
README.md Normal file
View File

@@ -0,0 +1,53 @@
![GF Logo](doc/Logos/gf1.svg)
# Grammatical Framework (GF)
[![Build Status](https://travis-ci.org/GrammaticalFramework/gf-core.svg?branch=master)](https://travis-ci.org/GrammaticalFramework/gf-core)
The Grammatical Framework is a grammar formalism based on type theory.
It consists of:
- a special-purpose programming language
- a compiler of the language
- a generic grammar processor
The compiler reads GF grammars from user-provided files, and the
generic grammar processor performs various tasks with the grammars:
- generation
- parsing
- translation
- type checking
- computation
- paraphrasing
- random generation
- syntax editing
GF particularly addresses four aspects of grammars:
- multilinguality (parallel grammars for different languages)
- semantics (semantic conditions of well-formedness, semantic properties of expressions)
- grammar engineering (modularity, abstractions, libraries)
- embeddability in programs written in other languages (C, C++, Haskell, Java, JavaScript)
## Compilation and installation
The simplest way of installing GF is with the command:
```
cabal install
```
For more details, see the [download page](http://www.grammaticalframework.org/download/index.html)
and [developers manual](http://www.grammaticalframework.org/doc/gf-developers.html).
## About this repository
On 2018-07-25, the monolithic [GF repository](https://github.com/GrammaticalFramework/GF)
was split in two:
1. [gf-core](https://github.com/GrammaticalFramework/gf-core) — the GF compiler, shell and runtimes
2. [gf-rgl](https://github.com/GrammaticalFramework/gf-rgl) — the resource grammar library
The former repository is now archived and no longer updated.
The split was performed using [this script](https://github.com/GrammaticalFramework/GF/blob/30ae1b5a5f73513ac5825ca6712186ef8afe9fd4/split/run.sh)
and the output of that script is [here](https://gist.github.com/johnjcamilleri/a6c43ff61f15a9657b457ac94ab7db61).

400
Setup.hs
View File

@@ -1,342 +1,82 @@
module Main where
import Distribution.System(Platform(..),OS(..))
import Distribution.Simple(defaultMainWithHooks,UserHooks(..),simpleUserHooks)
import Distribution.Simple.LocalBuildInfo(LocalBuildInfo(..),absoluteInstallDirs,datadir)
import Distribution.Simple.Setup(BuildFlags(..),Flag(..),InstallFlags(..),CopyDest(..),CopyFlags(..),SDistFlags(..))
import Distribution.PackageDescription(PackageDescription(..),emptyHookedBuildInfo)
import Distribution.Simple.BuildPaths(exeExtension)
import System.FilePath((</>),(<.>))
import Distribution.Simple
import Distribution.Simple.LocalBuildInfo
import Distribution.Simple.BuildPaths
import Distribution.Simple.Utils
import Distribution.Simple.Setup
import Distribution.PackageDescription hiding (Flag)
import Control.Monad
import Data.Maybe
import Data.List(isPrefixOf)
import System.IO
import System.Cmd
import System.FilePath
import System.Directory
import System.Environment
import System.Process
import System.Exit
import WebSetup
-- | Notice about RGL not built anymore
noRGLmsg :: IO ()
noRGLmsg = putStrLn "Notice: the RGL is not built as part of GF anymore. See https://github.com/GrammaticalFramework/gf-rgl"
main :: IO ()
main = defaultMainWithHooks simpleUserHooks{ preBuild =checkRGLArgs
, postBuild=buildRGL
, preInst =checkRGLArgs
, postInst =installRGL
, preCopy =checkRGLArgs
, postCopy =copyRGL
, sDistHook=sdistRGL
, runTests =testRGL
}
--------------------------------------------------------
-- Commands for building the Resource Grammar Library
--------------------------------------------------------
data Mode = AllTenses | Present | Minimal deriving Show
all_modes = ["minimal","present","alltenses"]
default_modes = [Present,AllTenses]
data RGLCommand
= RGLCommand
{ cmdName :: String
, cmdIsDef :: Bool
, cmdAction :: [Mode] -> [String] -> PackageDescription -> LocalBuildInfo -> IO ()
}
rglCommands =
[ RGLCommand "prelude" True $ \mode args pkg lbi -> do
putStrLn $ "Compiling [prelude]"
let prelude_src_dir = rgl_src_dir </> "prelude"
prelude_dst_dir = rgl_dst_dir lbi </> "prelude"
createDirectoryIfMissing True prelude_dst_dir
files <- getDirectoryContents prelude_src_dir
run_gfc pkg lbi (["-s", "--gfo-dir="++prelude_dst_dir] ++ [prelude_src_dir </> file | file <- files, take 1 file /= "."])
, RGLCommand "lang" True $ \mode args pkg lbi -> do
mapM_ (gfc mode pkg lbi . lang) (optl langsLang args)
mapM_ (gfc mode pkg lbi . symbol) (optl langsAPI args)
, RGLCommand "compat" True $ \mode args pkg lbi -> do
mapM_ (gfc mode pkg lbi . compat) (optl langsCompat args)
, RGLCommand "api" True $ \mode args pkg lbi -> do
mapM_ (gfc mode pkg lbi . try) (optl langsAPI args)
mapM_ (gfc mode pkg lbi . symbolic) (optl langsSymbolic args)
, RGLCommand "pgf" False $ \modes args pkg lbi ->
sequence_ [
do let dir = getRGLBuildDir lbi mode
createDirectoryIfMissing True dir
sequence_ [run_gfc pkg lbi ["-s","-make","-name=Lang"++la,
dir ++ "/Lang" ++ la ++ ".gfo"]
| (_,la) <- optl langsPGF args]
run_gfc pkg lbi (["-s","-make","-name=Lang"]++
["Lang" ++ la ++ ".pgf"|(_,la)<-optl langsPGF args])
| mode <- modes]
, RGLCommand "demo" False $ \mode args pkg lbi -> do
let ls = optl langsDemo args
gf (demos "Demo" ls) ["demo/Demo" ++ la ++ ".gf" | (_,la) <- ls] pkg lbi
return ()
, RGLCommand "parse" False $ \mode args pkg lbi -> do
mapM_ (gfc mode pkg lbi . parse) (optl langsParse args)
, RGLCommand "none" False $ \mode args pkg lbi -> do
return ()
]
main = defaultMainWithHooks simpleUserHooks
{ preBuild = gfPreBuild
, postBuild = gfPostBuild
, preInst = gfPreInst
, postInst = gfPostInst
, postCopy = gfPostCopy
, sDistHook = gfSDist
}
where
optl ls args = getOptLangs ls args
gfPreBuild args = gfPre args . buildDistPref
gfPreInst args = gfPre args . installDistPref
--------------------------------------------------------
gfPre args distFlag = do
return emptyHookedBuildInfo
checkRGLArgs args flags = do
let args' = filter (\arg -> not (arg `elem` all_modes ||
rgl_prefix `isPrefixOf` arg ||
langs_prefix `isPrefixOf` arg)) args
if null args'
then return emptyHookedBuildInfo
else die $ "Unrecognised flags: " ++ intercalate ", " args'
gfPostBuild args flags pkg lbi = do
noRGLmsg
let gf = default_gf lbi
buildWeb gf flags (pkg,lbi)
buildRGL args flags pkg lbi = do
let cmds = getRGLCommands args
let modes = getOptMode args
mapM_ (\cmd -> cmdAction cmd modes args pkg lbi) cmds
gfPostInst args flags pkg lbi = do
noRGLmsg
saveInstallPath args flags (pkg,lbi)
installWeb (pkg,lbi)
installRGL args flags pkg lbi = do
let modes = getOptMode args
let inst_gf_lib_dir = datadir (absoluteInstallDirs pkg lbi NoCopyDest) </> "lib"
copyAll "prelude" (rgl_dst_dir lbi </> "prelude") (inst_gf_lib_dir </> "prelude")
sequence_ [copyAll (show mode) (getRGLBuildDir lbi mode) (inst_gf_lib_dir </> getRGLBuildSubDir lbi mode)|mode<-modes]
gfPostCopy args flags pkg lbi = do
noRGLmsg
saveCopyPath args flags (pkg,lbi)
copyWeb flags (pkg,lbi)
copyRGL args flags pkg lbi = do
let modes = getOptMode args
dest = case copyDest flags of
NoFlag -> NoCopyDest
Flag d -> d
let inst_gf_lib_dir = datadir (absoluteInstallDirs pkg lbi dest) </> "lib"
copyAll "prelude" (rgl_dst_dir lbi </> "prelude") (inst_gf_lib_dir </> "prelude")
sequence_ [copyAll (show mode) (getRGLBuildDir lbi mode) (inst_gf_lib_dir </> getRGLBuildSubDir lbi mode)|mode<-modes]
-- `cabal sdist` will not make a proper dist archive, for that see `make sdist`
-- However this function should exit quietly to allow building gf in sandbox
gfSDist pkg lbi hooks flags = do
return ()
copyAll s from to = do
putStrLn $ "Installing [" ++ s ++ "] " ++ to
createDirectoryIfMissing True to
files <- fmap (filter (\f -> take 1 f /= ".")) $ getDirectoryContents from
mapM_ (\file -> copyFile (from </> file) (to </> file)) files
saveInstallPath :: [String] -> InstallFlags -> (PackageDescription, LocalBuildInfo) -> IO ()
saveInstallPath args flags bi = do
let
dest = NoCopyDest
dir = datadir (uncurry absoluteInstallDirs bi dest)
writeFile dataDirFile dir
sdistRGL pkg mb_lbi hooks flags = do
paths <- getRGLFiles rgl_src_dir []
let pkg' = pkg{dataFiles=paths}
sDistHook simpleUserHooks pkg' mb_lbi hooks flags
saveCopyPath :: [String] -> CopyFlags -> (PackageDescription, LocalBuildInfo) -> IO ()
saveCopyPath args flags bi = do
let
dest = case copyDest flags of
NoFlag -> NoCopyDest
Flag d -> d
dir = datadir (uncurry absoluteInstallDirs bi dest)
writeFile dataDirFile dir
-- | Name of file where installation's data directory is recording
-- This is a last-resort way in which the seprate RGL build script
-- can determine where to put the compiled RGL files
dataDirFile :: String
dataDirFile = "DATA_DIR"
-- | Get path to locally-built gf
default_gf :: LocalBuildInfo -> FilePath
default_gf lbi = buildDir lbi </> exeName' </> exeNameReal
where
getRGLFiles dir paths = do
files <- getDirectoryContents dir
foldM (processFile dir) paths [file | file <- files, file /= "." && file /= ".."]
processFile dir paths file = do
let path = dir </> file
print path
isFile <- doesFileExist path
if isFile
then if takeExtension file == ".gf" || file == "LICENSE"
then return (path : paths)
else return paths
else getRGLFiles path paths
testRGL args _ pkg lbi = do
let paths = case args of
[] -> ["testsuite"]
paths -> paths
sequence_ [walk path | path <- paths]
where
walk path = do
files <- getDirectoryContents path
sequence_ [walkFile (path </> file) | file <- files, file /= "." && file /= ".."]
walkFile fpath = do
exists <- doesFileExist fpath
if exists
then if takeExtension fpath == ".gfs"
then do let in_file = fpath
gold_file = addExtension fpath ".gold"
out_file = addExtension fpath ".out"
putStr (in_file++" ... ")
hFlush stdout
res <- runTest in_file out_file gold_file
putStrLn (if res then "OK" else "FAIL")
else return ()
else walk fpath
runTest in_file out_file gold_file = do
inp <- readFile in_file
out <- readProcess (default_gf pkg lbi) ["-run"] inp
writeFile out_file out
exists <- doesFileExist gold_file
if exists
then do gold <- readFile gold_file
return $! (out == gold)
else return False
rgl_src_dir = "lib" </> "src"
rgl_dst_dir lbi = buildDir lbi </> "rgl"
-- the languages have long directory names and short ISO codes (3 letters)
-- we also give the decodings for postprocessing linearizations, as long as grammars
-- don't support all flags needed; they are used in tests
langsCoding = [
(("amharic", "Amh"),""),
(("arabic", "Ara"),""),
(("bulgarian","Bul"),""),
(("catalan", "Cat"),""),
(("danish", "Dan"),""),
(("dutch", "Dut"),""),
(("english", "Eng"),""),
(("finnish", "Fin"),""),
(("french", "Fre"),""),
(("hindi", "Hin"),"to_devanagari"),
(("german", "Ger"),""),
(("interlingua","Ina"),""),
(("italian", "Ita"),""),
(("latin", "Lat"),""),
(("norwegian","Nor"),""),
(("polish", "Pol"),""),
(("romanian", "Ron"),""),
(("russian", "Rus"),""),
(("spanish", "Spa"),""),
(("swedish", "Swe"),""),
(("thai", "Tha"),"to_thai"),
(("turkish", "Tur"),""),
(("urdu", "Urd"),"")
]
langs = map fst langsCoding
-- default set of languages to compile
-- defaultLangs = langs `only` words "Eng Fre Ger Ita Spa Swe"
-- languagues for which to compile Lang
langsLang = langs `except` ["Amh","Ara","Lat","Hin","Tha","Tur"]
--langsLang = langs `only` ["Fin"] --test
-- languages for which to compile Try
langsAPI = langsLang `except` ["Hin","Ina","Tha"]
-- languages for which to compile Symbolic
langsSymbolic = langsAPI `except` ["Rus"]
-- languages for which to run demo test
langsDemo = langsLang `except` ["Ara","Hin","Ina","Tha"]
-- languages for which to compile parsing grammars
langsParse = langs `only` ["Eng"]
-- languages for which langs.pgf is built
langsPGF = langsLang `except` ["Ara","Hin","Ron","Tha"]
-- languages for which Compatibility exists (to be extended)
langsCompat = langsLang `only` ["Cat","Eng","Fin","Fre","Ita","Spa","Swe"]
gfc modes pkg lbi file = sequence_ [gfc1 mode pkg lbi file | mode<-modes]
gfc1 mode pkg lbi file = do
let dir = getRGLBuildDir lbi mode
preproc = case mode of
AllTenses -> ""
Present -> "-preproc="++({-rgl_src_dir </>-} "mkPresent")
Minimal -> "-preproc="++({-rgl_src_dir </>-} "mkMinimal")
createDirectoryIfMissing True dir
putStrLn $ "Compiling [" ++ show mode ++ "] " ++ file
run_gfc pkg lbi ["-s", preproc, "--gfo-dir="++dir, file]
gf comm files pkg lbi = do
putStrLn $ "Reading " ++ unwords files
let gf = default_gf pkg lbi
putStrLn ("executing: " ++ comm ++ "\n" ++
"in " ++ gf)
out <- readProcess gf ("-s":files) comm
putStrLn out
demos abstr ls = "gr -number=100 | l -treebank " ++ unlexer abstr ls ++
" | ps -to_html | wf -file=resdemo.html"
lang (lla,la) = rgl_src_dir </> lla </> ("All" ++ la ++ ".gf")
compat (lla,la) = rgl_src_dir </> lla </> ("Compatibility" ++ la ++ ".gf")
symbol (lla,la) = rgl_src_dir </> lla </> ("Symbol" ++ la ++ ".gf")
try (lla,la) = rgl_src_dir </> "api" </> ("Try" ++ la ++ ".gf")
syntax (lla,la) = rgl_src_dir </> "api" </> ("Syntax" ++ la ++ ".gf")
symbolic (lla,la) = rgl_src_dir </> "api" </> ("Symbolic" ++ la ++ ".gf")
parse (lla,la) = rgl_src_dir </> "parse" </> ("Parse" ++ la ++ ".gf")
except ls es = filter (flip notElem es . snd) ls
only ls es = filter (flip elem es . snd) ls
getOptMode args =
if null explicit_modes
then default_modes
else explicit_modes
where
explicit_modes =
[Minimal|have "minimal"]++
[Present|have "present"]++
[AllTenses|have "alltenses"]
have mode = mode `elem` args
-- list of languages overriding the definitions above
getOptLangs defaultLangs args =
case [ls | arg <- args,
let (f,ls) = splitAt (length langs_prefix) arg,
f==langs_prefix] of
('+':ls):_ -> foldr addLang defaultLangs (seps ls)
('-':ls):_ -> foldr removeLang defaultLangs (seps ls)
ls:_ -> findLangs langs (seps ls)
_ -> defaultLangs
where
seps = words . map (\c -> if c==',' then ' ' else c)
findLangs langs ls = [lang | lang@(_,la) <- langs, la `elem` ls]
removeLang l ls = [lang | lang@(_,la) <- ls, la/=l]
addLang l ls = if null (findLangs ls [l])
then findLangs langs [l]++ls
else ls
getRGLBuildSubDir lbi mode =
case mode of
AllTenses -> "alltenses"
Present -> "present"
Minimal -> "minimal"
getRGLBuildDir lbi mode = rgl_dst_dir lbi </> getRGLBuildSubDir lbi mode
getRGLCommands args =
let cmds0 = [cmd | arg <- args,
let (prefix,name) = splitAt (length rgl_prefix) arg,
prefix == rgl_prefix,
cmd <- rglCommands,
cmdName cmd == name]
in if null cmds0
then [cmd | cmd <- rglCommands, cmdIsDef cmd]
else cmds0
langs_prefix = "langs="
rgl_prefix = "rgl-"
unlexer abstr ls =
"-unlexer=\\\"" ++ unwords
[abstr ++ la ++ "=" ++ unl |
lla@(_,la) <- ls, let unl = unlex lla, not (null unl)] ++
"\\\""
where
unlex lla = maybe "" id $ lookup lla langsCoding
-- | Runs the gf executable in compile mode with the given arguments.
run_gfc :: PackageDescription -> LocalBuildInfo -> [String] -> IO ()
run_gfc pkg lbi args =
do let args' = ["-batch","-gf-lib-path="++rgl_src_dir,"+RTS","-K32M","-RTS"] ++ filter (not . null) args
gf = default_gf pkg lbi
putStrLn $ "Running: " ++ gf ++ " " ++ unwords (map showArg args')
e <- rawSystem gf args'
case e of
ExitSuccess -> return ()
ExitFailure i -> die $ "gf exited with exit code: " ++ show i
where showArg arg = "'" ++ arg ++ "'"
default_gf pkg lbi = buildDir lbi </> exeName' </> exeNameReal
where
exeName' = (exeName . head . executables) pkg
exeNameReal = exeName' <.> (if null $ takeExtension exeName' then exeExtension else "")
-- shadows Distribution.Simple.BuildPaths.exeExtension, which changed type signature in Cabal 2.4
exeExtension = case hostPlatform lbi of
Platform arch Windows -> "exe"
_ -> ""
exeName' = "gf"
exeNameReal = exeName' <.> exeExtension

141
WebSetup.hs Normal file
View File

@@ -0,0 +1,141 @@
module WebSetup(buildWeb,installWeb,copyWeb,numJobs,execute) where
import System.Directory(createDirectoryIfMissing,copyFile,doesDirectoryExist,doesFileExist)
import System.FilePath((</>),dropExtension)
import System.Process(rawSystem)
import System.Exit(ExitCode(..))
import Distribution.Simple.Setup(BuildFlags(..),Flag(..),CopyFlags(..),CopyDest(..),copyDest)
import Distribution.Simple.LocalBuildInfo(LocalBuildInfo(..),datadir,buildDir,absoluteInstallDirs)
import Distribution.PackageDescription(PackageDescription(..))
{-
To test the GF web services, the minibar and the grammar editor, use
"cabal install" (or "runhaskell Setup.hs install") to install gf as usual.
Then start the server with the command "gf -server" and open
http://localhost:41296/ in your web browser (Firefox, Safari, Opera or
Chrome). The example grammars listed below will be available in the minibar.
-}
{-
Update 2018-07-04
The example grammars have now been removed from the GF repository.
This script will look for them in ../gf-contrib and build them from there if possible.
If not, the user will be given a message and nothing is build or copied.
(Unfortunately cabal install seems to hide all messages from stdout,
so users won't see this message unless they check the log.)
-}
example_grammars :: [(String, String, [String])] -- [(pgf, subdir, source modules)]
example_grammars =
[("Letter.pgf","letter",letterSrc)
,("Foods.pgf","foods",foodsSrc)
,("Phrasebook.pgf","phrasebook",phrasebookSrc)
]
where
foodsSrc = ["Foods"++lang++".gf"|lang<-foodsLangs]
foodsLangs = words "Afr Amh Bul Cat Cze Dut Eng Epo Fin Fre Ger Gle Heb Hin Ice Ita Jpn Lav Mlt Mon Nep Pes Por Ron Spa Swe Tha Tsn Tur Urd"
phrasebookSrc = ["Phrasebook"++lang++".gf"|lang<-phrasebookLangs]
phrasebookLangs = words "Bul Cat Chi Dan Dut Eng Lav Hin Nor Spa Swe Tha" -- only fastish languages
letterSrc = ["Letter"++lang++".gf"|lang<-letterLangs]
letterLangs = words "Eng Fin Fre Heb Rus Swe"
contrib_dir :: FilePath
contrib_dir = ".."</>"gf-contrib"
buildWeb :: String -> BuildFlags -> (PackageDescription, LocalBuildInfo) -> IO ()
buildWeb gf flags (pkg,lbi) = do
contrib_exists <- doesDirectoryExist contrib_dir
if contrib_exists
then mapM_ build_pgf example_grammars
else putStr $ unlines
[ "Example grammars are no longer included in the main GF repository, but have moved to gf-contrib."
, "If you want these example grammars to be built, clone this repository in the same top-level directory as GF:"
, "https://github.com/GrammaticalFramework/gf-contrib.git"
]
where
gfo_dir = buildDir lbi </> "examples"
build_pgf :: (String, String, [String]) -> IO Bool
build_pgf (pgf,subdir,src) =
do createDirectoryIfMissing True tmp_dir
putStrLn $ "Building "++pgf
execute gf args
where
tmp_dir = gfo_dir</>subdir
dir = contrib_dir</>subdir
dest = NoCopyDest
gf_lib_path = datadir (absoluteInstallDirs pkg lbi dest) </> "lib"
args = numJobs flags++["-make","-s"] -- ,"-optimize-pgf"
++["--gfo-dir="++tmp_dir,
--"--gf-lib-path="++gf_lib_path,
"--name="++dropExtension pgf,
"--output-dir="++gfo_dir]
++[dir</>file|file<-src]
installWeb :: (PackageDescription, LocalBuildInfo) -> IO ()
installWeb = setupWeb NoCopyDest
copyWeb :: CopyFlags -> (PackageDescription, LocalBuildInfo) -> IO ()
copyWeb flags = setupWeb dest
where
dest = case copyDest flags of
NoFlag -> NoCopyDest
Flag d -> d
setupWeb :: CopyDest -> (PackageDescription, LocalBuildInfo) -> IO ()
setupWeb dest (pkg,lbi) = do
mapM_ (createDirectoryIfMissing True) [grammars_dir,cloud_dir]
contrib_exists <- doesDirectoryExist contrib_dir
if contrib_exists
then mapM_ copy_pgf example_grammars
else return () -- message already displayed from buildWeb
copyGFLogo
where
grammars_dir = www_dir </> "grammars"
cloud_dir = www_dir </> "tmp" -- hmm
logo_dir = www_dir </> "Logos"
www_dir = datadir (absoluteInstallDirs pkg lbi dest) </> "www"
gfo_dir = buildDir lbi </> "examples"
copy_pgf :: (String, String, [String]) -> IO ()
copy_pgf (pgf,subdir,_) =
do let src = gfo_dir </> pgf
let dst = grammars_dir </> pgf
ex <- doesFileExist src
if ex then do putStrLn $ "Installing "++dst
copyFile src dst
else putStrLn $ "Not installing "++dst
gf_logo = "gf0.png"
copyGFLogo =
do createDirectoryIfMissing True logo_dir
copyFile ("doc"</>"Logos"</>gf_logo) (logo_dir</>gf_logo)
-- | Run an arbitrary system command, returning False on failure
execute :: String -> [String] -> IO Bool
execute command args =
do let cmdline = command ++ " " ++ unwords (map showArg args)
e <- rawSystem command args
case e of
ExitSuccess -> return True
ExitFailure i -> do putStrLn $ "Ran: " ++ cmdline
putStrLn $ command++" exited with exit code: " ++ show i
return False
where
showArg arg = if ' ' `elem` arg then "'" ++ arg ++ "'" else arg
-- | This function is used to enable parallel compilation of the RGL and example grammars
numJobs :: BuildFlags -> [String]
numJobs flags =
if null n
then ["-j","+RTS","-A20M","-N","-RTS"]
else ["-j="++n,"+RTS","-A20M","-N"++n,"-RTS"]
where
-- buildNumJobs is only available in Cabal>=1.20
n = case buildNumJobs flags of
Flag mn | mn/=Just 1-> maybe "" show mn
_ -> ""

104
bin/build-binary-dist.sh Executable file
View File

@@ -0,0 +1,104 @@
#! /bin/bash
### This script builds a binary distribution of GF from the source
### package that this script is a part of. It assumes that you have installed
### a recent version of the Haskell Platform.
### Two binary package formats are supported: plain tar files (.tar.gz) and
### OS X Installer packages (.pkg).
os=$(uname) # Operating system name (e.g. Darwin or Linux)
hw=$(uname -m) # Hardware name (e.g. i686 or x86_64)
# GF version number:
ver=$(grep -i ^version: gf.cabal | sed -e 's/version://' -e 's/ //g')
name="gf-$ver"
destdir="$PWD/dist/$name" # assemble binary dist here
prefix=${PREFIX:-/usr/local} # where to install
fmt=${FMT:-tar.gz} # binary package format (tar.gz or pkg)
ghc=${GHC:-ghc} # which Haskell compiler to use
extralib="$destdir$prefix/lib"
extrainclude="$destdir$prefix/include"
extra="--extra-lib-dirs=$extralib --extra-include-dirs=$extrainclude"
set -e # Stop if an error occurs
set -x # print commands before executing them
## First configure & build the C run-time system
pushd src/runtime/c
bash setup.sh configure --prefix="$prefix"
bash setup.sh build
bash setup.sh install prefix="$destdir$prefix"
popd
## Build the python binding to the C run-time system
if which >/dev/null python; then
pushd src/runtime/python
EXTRA_INCLUDE_DIRS="$extrainclude" EXTRA_LIB_DIRS="$extralib" python setup.py build
python setup.py install --prefix="$destdir$prefix"
if [ "$fmt" == pkg ] ; then
# A hack for Python on OS X to find the PGF modules
pyver=$(ls "$destdir$prefix/lib" | sed -n 's/^python//p')
pydest="$destdir/Library/Python/$pyver/site-packages"
mkdir -p "$pydest"
ln "$destdir$prefix/lib/python$pyver/site-packages"/pgf* "$pydest"
fi
popd
else
echo "Python is not installed, so the Python binding will not be included"
fi
## Build the Java binding to the C run-time system
if which >/dev/null javac && which >/dev/null jar ; then
pushd src/runtime/java
rm -f libjpgf.la # In case it contains the wrong INSTALL_PATH
if make CFLAGS="-I$extrainclude -L$extralib" INSTALL_PATH="$prefix/lib"
then
make INSTALL_PATH="$destdir$prefix/lib" install
else
echo "*** Skipping the Java binding because of errors"
fi
popd
else
echo "Java SDK is not installed, so the Java binding will not be included"
fi
## Build GF, with C run-time support enabled
cabal install -w "$ghc" --only-dependencies -fserver -fc-runtime $extra
cabal configure -w "$ghc" --prefix="$prefix" -fserver -fc-runtime $extra
DYLD_LIBRARY_PATH="$extralib" LD_LIBRARY_PATH="$extralib" cabal build
# Building the example grammars will fail, because the RGL is missing
cabal copy --destdir="$destdir" # create www directory
## Build the RGL and copy it to $destdir
PATH=$PWD/dist/build/gf:$PATH
export GF_LIB_PATH="$(dirname $(find "$destdir" -name www))/lib" # hmm
mkdir -p "$GF_LIB_PATH"
pushd ../gf-rgl
make build
make copy
popd
# Build GF again, including example grammars that need the RGL
DYLD_LIBRARY_PATH="$extralib" LD_LIBRARY_PATH="$extralib" cabal build
## Copy GF to $destdir
cabal copy --destdir="$destdir"
libdir=$(dirname $(find "$destdir" -name PGF.hi))
cabal register --gen-pkg-config=$libdir/gf-$ver.conf
## Create the binary distribution package
case $fmt in
tar.gz)
targz="$name-bin-$hw-$os.tar.gz" # the final tar file
tar -C "$destdir/$prefix" -zcf "dist/$targz" .
echo "Created $targz, consider renaming it to something more user friendly"
;;
pkg)
pkg=$name.pkg
pkgbuild --identifier org.grammaticalframework.gf.pkg --version "$ver" --root "$destdir" --install-location / dist/$pkg
echo "Created $pkg"
esac
rm -r "$destdir"

20
bin/clean_html Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/bash
# This script finds all .t2t (txt2tags) and .md (Markdown) files
# and deletes the corresponding HTML file of the same name.
find . -name '*.t2t' | while read t2t ; do
html="${t2t%.t2t}.html"
if [ -f "$html" ] ; then
echo "$html"
rm -f "$html"
fi
done
find . -name '*.md' | while read md ; do
html="${md%.md}.html"
if [ -f "$html" ] ; then
echo "$html"
rm -f "$html"
fi
done

0
bin/gfmap Normal file → Executable file
View File

146
bin/template.html Normal file
View File

@@ -0,0 +1,146 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="$lang$" xml:lang="$lang$"$if(dir)$ dir="$dir$"$endif$>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
$for(author-meta)$
<meta name="author" content="$author-meta$" />
$endfor$
$if(date-meta)$
<meta name="dcterms.date" content="$date-meta$" />
$endif$
$if(keywords)$
<meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" />
$endif$
<title>$if(title-prefix)$$title-prefix$ $endif$$pagetitle$</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.2/css/all.css" integrity="sha384-/rXc/GQVaYpyDdyxK+ecHPVYJSN9bmVFBvjA/9eOB+pb3F2w2N6fc5qB9Ew5yIns" crossorigin="anonymous">
$for(css)$
<link rel="stylesheet" href="$css$" />
$endfor$
$if(math)$
$math$
$endif$
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
$for(header-includes)$
$header-includes$
$endfor$
</head>
<body class="bg-light">
<div class="bg-white pb-5">
$for(include-before)$
$include-before$
$endfor$
<div class="container-fluid py-5" style="max-width:1200px">
$if(title)$
<header id="title-block-header">
<a href="$rel-root$" title="Home">
<img src="$rel-root$/doc/Logos/gf1.svg" height="200" class="float-md-right ml-3 mb-3 bg-white" alt="GF Logo">
</a>
<h1 class="title">$title$</h1>
$if(subtitle)$
<p class="subtitle">$subtitle$</p>
$endif$
$for(author)$
<p class="author">$author$</p>
$endfor$
$if(date)$
<p class="date">$date$</p>
$endif$
</header>
$endif$
$if(toc)$
<nav id="$idprefix$TOC">
$if(table-of-contents)$
<!-- pandoc >= 2.0 -->
$table-of-contents$
$else$
<!-- pandoc < 2.0 -->
$toc$
$endif$
</nav>
$endif$
$body$
</div><!-- .container -->
</div><!-- .bg-white -->
<footer class="py-5">
<div class="container">
<div class="row">
<div class="col-6 col-sm-3">
<a href="$rel-root$">
<i class="fas fa-home"></i>
Home
</a>
<h6 class="text-muted mt-3">Get started</h6>
<ul class="list-unstyled">
<li><a href="https://www.youtube.com/watch?v=x1LFbDQhbso">Google Tech Talk</a></li>
<li><a href="http://cloud.grammaticalframework.org/">GF Cloud</a></li>
<li>
<a href="$rel-root$/doc/tutorial/gf-tutorial.html">Tutorial</a>
/
<a href="$rel-root$/lib/doc/rgl-tutorial/index.html">RGL Tutorial</a>
</li>
<li><a href="$rel-root$/download"><strong>Download GF</strong></a></li>
</ul>
</div>
<div class="col-6 col-sm-3">
<h6 class="text-muted">Learn more</h6>
<ul class="list-unstyled">
<li><a href="$rel-root$/gf-book">The GF Book</a></li>
<li><a href="$rel-root$/doc/gf-refman.html">Reference Manual</a></li>
<li><a href="$rel-root$/doc/gf-shell-reference.html">GF Shell Reference</a></li>
<li><a href="http://www.molto-project.eu/sites/default/files/MOLTO_D2.3.pdf">Best Practices</a></li>
<li><a href="$rel-root$/lib/doc/synopsis/index.html"><strong>RGL Synopsis</strong></a></li>
</ul>
</div>
<div class="col-6 col-sm-3">
<h6 class="text-muted">Develop</h6>
<ul class="list-unstyled">
<li><a href="$rel-root$/doc/gf-developers.html">Developers Guide</a></li>
<li><a href="http://hackage.haskell.org/package/gf/docs/PGF.html">PGF library API (Haskell runtime)</a></li>
<li><a href="$rel-root$/doc/runtime-api.html">PGF library API (C runtime)</a></li>
<li><a href="http://hackage.haskell.org/package/gf/docs/GF.html">GF compiler API</a></li>
<li><a href="$rel-root$/doc/gf-editor-modes.html">Text Editor Support</a></li>
</ul>
</div>
<div class="col-6 col-sm-3">
<h6 class="text-muted">Contribute</h6>
<ul class="list-unstyled">
<li><a href="http://groups.google.com/group/gf-dev">Mailing List</a></li>
<li><a href="https://github.com/GrammaticalFramework/gf-core/issues">Issue Tracker</a></li>
<li><a href="$rel-root$/doc/gf-people.html">Authors</a></li>
<li><a href="http://school.grammaticalframework.org/2018/">Summer School</a></li>
</ul>
<h6 class="text-muted">
Repositories
<i class="fab fa-github ml-1"></i>
</h6>
<a href="https://github.com/GrammaticalFramework/gf-core">GF</a> ·
<a href="https://github.com/GrammaticalFramework/gf-rgl">RGL</a> ·
<a href="https://github.com/GrammaticalFramework/gf-contrib">Contributions</a>
</div>
</div>
</div>
</footer>
$for(include-after)$
$include-after$
$endfor$
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-7811807-3");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>

159
bin/update_html Normal file → Executable file
View File

@@ -1,11 +1,156 @@
#!/bin/bash
### This script finds all .t2t (txt2tags) files and updates the corresponding
### .html file, if it is out-of-date.
# Generate HTML from txt2tags (.t2t) and Markdown (.md)
# Usage:
# - update_html
# Look for all .t2t and .md files in the current directory and below,
# generating the output HTML when the source is newer than the HTML.
# - update_html path/to/file.t2t path/to/another.md
# Generate HTML for the specified file(s), ignoring modification time.
#
# Requires:
# - txt2tags for .t2t files. Tested with 2.6.
# - pandoc for both .t2t and .md files. Tested with 1.16.0.2 and 2.3.1.
# - the template file `template.html` in the same directory as this script.
#
# Tested with Ubuntu 16.04 and macOS Mojave.
#
# See also clean_html for removing the files generated by this script.
find . -name '*.t2t' | while read t2t ; do
html="${t2t%.t2t}.html"
if [ "$t2t" -nt "$html" ] ; then
txt2tags -thtml "$t2t"
# Path to directory where this script is
# https://stackoverflow.com/a/246128/98600
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
# HTML template
template="$DIR/template.html"
# Render txt2tags into html file
# Arguments:
# 1. txt2tags source file, e.g. download/index.t2t
# 2. html target file, e.g. download/index.html
function render_t2t_html {
t2t="$1"
html="$2"
tmp="$2.tmp"
relroot="$( dirname $t2t | sed -E 's/^.\///' | sed -E 's/[^/]+/../g' )"
# First render with txt2tags to handle pre/post processing
txt2tags \
--target=html \
--no-headers \
--quiet \
--outfile="$tmp" \
--infile="$t2t"
# Replace <A NAME="toc3"></A> with <div id="toc3"></div> so that Pandoc retains it
# Do this for both cases since BSD sed doesn't support /i
sed -i.bak "s/<a name=\"\(.*\)\"><\/a>/<div id=\"\1\"><\/div>/" "$tmp"
sed -i.bak "s/<A NAME=\"\(.*\)\"><\/A>/<div id=\"\1\"><\/div>/" "$tmp"
rm -f "$tmp.bak"
# Capture first 3 lines of t2t file: title, author, date
# Documentation here: https://txt2tags.org/userguide/headerarea
l1=$(head -n 1 "$t2t")
l2=$(tail -n+2 "$t2t" | head -n 1)
l3=$(tail -n+3 "$t2t" | head -n 1)
title=
author=
date=
if [ -n "$l1" ] ; then
title="$l1"
if [ -n "$l2" ] ; then author="$l2" ; fi
if [ -n "$l3" ] ; then date="$l3" ; fi
fi
done
# Run txt2tag's HTML through Pandoc for cleanup
pandoc \
--from=html \
--to=html5 \
--standalone \
--template="$template" \
--variable="lang:en" \
--variable="rel-root:$relroot" \
--metadata="title:$title" \
--metadata="author:$author" \
--metadata="date:$date" \
"$tmp" \
--output="$html"
rm -f "$tmp"
# Final post-processing
if [ -f "$html" ] ; then
sed -i.bak "s/<table/<table class=\"table\"/" "$html" && rm "$html.bak"
echo "$html"
fi
}
# Render markdown into html file
# Arguments:
# 1. markdown source file, e.g. download/index.md
# 2. html target file, e.g. download/index.html
function render_md_html {
md="$1"
html="$2"
relroot="$( dirname $md | sed -E 's/^.\///' | sed -E 's/[^/]+/../g' )"
# Look for `show-toc: true` in metadata (first ten lines of file)
if head -n 10 "$md" | grep --quiet 'show-toc: true' ; then
tocflag='--table-of-contents'
else
tocflag=''
fi
pandoc \
--from=markdown \
--to=html5 \
--standalone \
$tocflag \
--template="$template" \
--variable="lang:en" \
--variable="rel-root:$relroot" \
"$md" \
--output="$html"
# Final post-processing
if [ -f "$html" ] ; then
# add "table" class to tables
sed -i.bak "s/<table/<table class=\"table\"/" "$html"
# rewrite anchors that Pandoc 1.16 ignores: [content]{#anchor} -> <span id="anchor">content</span>
sed -i.bak -E "s/\[(.*)\]\{#(.+)\}/<span id=\"\2\">\1<\/span>/" "$html"
rm -f "$html.bak"
echo "$html"
fi
}
# Main entry point
# Script can be run in one of two modes:
if [ $# -gt 0 ] ; then
# Render specific file(s) from args, ignoring dates
for file in "$@" ; do
ext="${file##*.}"
html="${file%.$ext}.html"
case $ext in
"md")
render_md_html "$file" "$html"
;;
"t2t")
render_t2t_html "$file" "$html"
;;
esac
done
else
# Render all files found in cwd and deeper if source is newer
find . -name '*.t2t' | while read file ; do
html="${file%.t2t}.html"
if [ "$file" -nt "$html" ] || [ "$template" -nt "$html" ] ; then
render_t2t_html "$file" "$html"
fi
done
find . -name '*.md' | while read file ; do
if [[ "$file" == *"README.md" ]] ; then continue ; fi
html="${file%.md}.html"
if [ "$file" -nt "$html" ] || [ "$template" -nt "$html" ] ; then
render_md_html "$file" "$html"
fi
done
fi

View File

@@ -1,35 +0,0 @@
#! /bin/bash
### This script builds a binary distribution of GF from the source package
### that this script is a part of. It also assumes that you have installed
### the Haskell Platform, version 2010.1.0.0 or 2010.2.0.0
destdir=/tmp/gf-build-binary-dist # assemble binary dist here
prefix=/usr/local # where to install
targz=gf-bin.tar.gz # the final tar file, should be renamed
langs="" # which languages?
#langs="langs=-Pol" # temporary problem with Polish, omit it
set -e # Stop if an error occurs
set -x # print commands before exuting them
cabal install # gf needs to be installed before building gf-server below
runhaskell Setup.hs configure --user --prefix $prefix
runhaskell Setup.hs build $langs
runhaskell Setup.hs copy --destdir=$destdir $langs
(
cd src/server
## If you don't already have the packages gf-server depends on, this is
## the easiest way to install them:
#cabal install
runhaskell Setup.hs configure --user --prefix $prefix
runhaskell Setup.hs build
runhaskell Setup.hs copy --destdir=$destdir
)
tar -C $destdir/$prefix -zcf $targz .
echo "Created $targz, rename it to something more informative"
rm -r $destdir

View File

@@ -1,232 +0,0 @@
-- GF C Bindings
-- Copyright (C) 2008-2010 Kevin Kofler
--
-- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License, or (at your option) any later version.
--
-- This library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public
-- License along with this library; if not, see <http://www.gnu.org/licenses/>.
module PGFFFI where
import PGF
import CString
import Foreign
import Foreign.C.Types
import Control.Exception
import IO
import Data.Maybe
-- import GF.Text.Lexing
-- Utility functions used in the implementation (not exported):
-- This is a kind of a hack, the FFI spec doesn't guarantee that this will work.
-- The alternative would be to use Ptr () instead of StablePtr a everywhere.
nullStablePtr :: StablePtr a
nullStablePtr = (castPtrToStablePtr nullPtr)
sizeOfStablePtr :: Int
sizeOfStablePtr = (sizeOf (nullStablePtr))
storeList :: [a] -> Ptr (StablePtr a) -> IO ()
storeList list buf = do
case list of
carlist:cdrlist -> do
sptr <- (newStablePtr carlist)
(poke buf sptr)
(storeList cdrlist (plusPtr buf sizeOfStablePtr))
[] -> (poke buf nullStablePtr)
listToArray :: [a] -> IO (Ptr (StablePtr a))
listToArray list = do
buf <- (mallocBytes ((sizeOfStablePtr) * ((length list) + 1)))
(storeList list buf)
return buf
-- * PGF
foreign export ccall "gf_freePGF" freeStablePtr :: StablePtr PGF -> IO ()
foreign export ccall gf_readPGF :: CString -> IO (StablePtr PGF)
gf_readPGF path = do
p <- (peekCString path)
result <- (readPGF p)
(newStablePtr result)
-- * Identifiers
foreign export ccall "gf_freeCId" freeStablePtr :: StablePtr CId -> IO ()
foreign export ccall gf_mkCId :: CString -> IO (StablePtr CId)
gf_mkCId str = do
s <- (peekCString str)
(newStablePtr (mkCId s))
foreign export ccall gf_wildCId :: IO (StablePtr CId)
gf_wildCId = do
(newStablePtr (wildCId))
foreign export ccall gf_showCId :: StablePtr CId -> IO CString
gf_showCId cid = do
c <- (deRefStablePtr cid)
(newCString (showCId c))
foreign export ccall gf_readCId :: CString -> IO (StablePtr CId)
gf_readCId str = do
s <- (peekCString str)
case (readCId s) of
Just x -> (newStablePtr x)
Nothing -> (return (nullStablePtr))
-- TODO: So we can create, print and free a CId, but can we do anything useful with it?
-- We need some kind of C wrapper for the tree datastructures.
-- * Languages
foreign export ccall "gf_freeLanguage" freeStablePtr :: StablePtr Language -> IO ()
foreign export ccall gf_showLanguage :: StablePtr Language -> IO CString
gf_showLanguage lang = do
l <- (deRefStablePtr lang)
(newCString (showLanguage l))
foreign export ccall gf_readLanguage :: CString -> IO (StablePtr Language)
gf_readLanguage str = do
s <- (peekCString str)
case (readLanguage s) of
Just x -> (newStablePtr x)
Nothing -> (return (nullStablePtr))
foreign export ccall gf_languages :: StablePtr PGF -> IO (Ptr (StablePtr Language))
gf_languages pgf = do
p <- (deRefStablePtr pgf)
(listToArray (languages p))
foreign export ccall gf_abstractName :: StablePtr PGF -> IO (StablePtr Language)
gf_abstractName pgf = do
p <- (deRefStablePtr pgf)
(newStablePtr (abstractName p))
foreign export ccall gf_languageCode :: StablePtr PGF -> StablePtr Language -> IO CString
gf_languageCode pgf lang = do
p <- (deRefStablePtr pgf)
l <- (deRefStablePtr lang)
case (languageCode p l) of
Just s -> (newCString s)
Nothing -> (return nullPtr)
-- * Types
foreign export ccall "gf_freeType" freeStablePtr :: StablePtr Type -> IO ()
-- TODO: Hypo
-- TODO: allow nonempty scope
foreign export ccall gf_showType :: StablePtr Type -> IO CString
gf_showType tp = do
t <- (deRefStablePtr tp)
(newCString (showType [] t))
foreign export ccall gf_readType :: CString -> IO (StablePtr Type)
gf_readType str = do
s <- (peekCString str)
case (readType s) of
Just x -> (newStablePtr x)
Nothing -> (return (nullStablePtr))
-- TODO: mkType, mkHypo, mkDepHypo, mkImplHypo
foreign export ccall gf_categories :: StablePtr PGF -> IO (Ptr (StablePtr CId))
gf_categories pgf = do
p <- (deRefStablePtr pgf)
(listToArray (categories p))
foreign export ccall gf_startCat :: StablePtr PGF -> IO (StablePtr Type)
gf_startCat pgf = do
p <- (deRefStablePtr pgf)
(newStablePtr (startCat p))
-- TODO: * Functions
-- * Expressions & Trees
-- ** Tree
foreign export ccall "gf_freeTree" freeStablePtr :: StablePtr Tree -> IO ()
-- ** Expr
foreign export ccall "gf_freeExpr" freeStablePtr :: StablePtr Expr -> IO ()
-- TODO: allow nonempty scope
foreign export ccall gf_showExpr :: StablePtr Expr -> IO CString
gf_showExpr expr = do
e <- (deRefStablePtr expr)
(newCString (showExpr [] e))
foreign export ccall gf_readExpr :: CString -> IO (StablePtr Expr)
gf_readExpr str = do
s <- (peekCString str)
case (readExpr s) of
Just x -> (newStablePtr x)
Nothing -> (return (nullStablePtr))
-- * Operations
-- ** Linearization
foreign export ccall gf_linearize :: StablePtr PGF -> StablePtr Language -> StablePtr Tree -> IO CString
gf_linearize pgf lang tree = do
p <- (deRefStablePtr pgf)
l <- (deRefStablePtr lang)
t <- (deRefStablePtr tree)
(newCString (linearize p l t))
-- TODO: linearizeAllLang, linearizeAll, bracketedLinearize, tabularLinearizes
-- TODO: groupResults
foreign export ccall gf_showPrintName :: StablePtr PGF -> StablePtr Language -> StablePtr CId -> IO CString
gf_showPrintName pgf lang cid = do
p <- (deRefStablePtr pgf)
l <- (deRefStablePtr lang)
c <- (deRefStablePtr cid)
(newCString (showPrintName p l c))
-- TODO: BracketedString(..), FId, LIndex, Forest.showBracketedString
-- ** Parsing
foreign export ccall gf_parse :: StablePtr PGF -> StablePtr Language -> StablePtr Type -> CString -> IO (Ptr (StablePtr Tree))
gf_parse pgf lang cat input = do
p <- (deRefStablePtr pgf)
l <- (deRefStablePtr lang)
c <- (deRefStablePtr cat)
i <- (peekCString input)
(listToArray (parse p l c i))
-- TODO: parseAllLang, parseAll, parse_, parseWithRecovery
-- TODO: ** Evaluation
-- TODO: ** Type Checking
-- TODO: ** Low level parsing API
-- TODO: ** Generation
-- TODO: ** Morphological Analysis
-- TODO: ** Visualizations
-- TODO: * Browsing
-- GF.Text.Lexing:
-- foreign export ccall gf_stringOp :: CString -> CString -> IO CString
-- gf_stringOp op str = do
-- o <- (peekCString op)
-- s <- (peekCString str)
-- case (stringOp o) of
-- Just fn -> (newCString (fn s))
-- Nothing -> (return nullPtr)
-- Unused (exception handling):
-- (Control.Exception.catch (listToArray (parse p l c i)) (\(e::SomeException) -> do
-- (hPutStr stderr ("error: " ++ show e))
-- (return nullPtr)))

View File

@@ -1,22 +0,0 @@
#!/bin/sh
# GF C Bindings
# Copyright (C) 2008-2010 Kevin Kofler
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, see <http://www.gnu.org/licenses/>.
src=../../src
import=-i$src/runtime/haskell:$src/compiler
gf --make ../../examples/tutorial/embedded/QueryEng.gf &&
ghc $import --make -fglasgow-exts -O2 -no-hs-main $* -c PGFFFI.hs &&
ghc $import --make -fglasgow-exts -O2 -no-hs-main $* gfctest.c gf_lexing.c PGFFFI.hs -o gfctest

View File

@@ -1,287 +0,0 @@
/* GF C Bindings
Copyright (C) 2010 Kevin Kofler
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "gf_lexing.h"
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
typedef char **(*GF_Lexer)(const char *str);
typedef char *(*GF_Unlexer)(char **arr);
static inline void freev(char **p)
{
char **q = p;
while (*q)
free(*(q++));
free(p);
}
static char **words(const char *str)
{
unsigned char *buf = (unsigned char *) strdup(str);
unsigned char *p = buf, *q;
char **result, **r;
size_t count = 0u;
while (isspace(*p)) p++;
q = p;
if (*p) count++;
while (*p) {
if (isspace(*p)) {
*(p++) = 0;
while (isspace(*p)) *(p++) = 0;
if (*p) count++;
} else p++;
}
r = result = malloc((count+1)*sizeof(char *));
if (count) while (1) {
*(r++) = strdup((char *) q);
if (!--count) break;
while (*q) q++;
while (!*q) q++;
}
*r = NULL;
return result;
}
static char *unwords(char **arr)
{
size_t len = 0u;
char **p = arr, *result, *r;
while (*p)
len += strlen(*(p++)) + 1u;
if (!len) return calloc(1, 1);
r = result = malloc(len);
p = arr;
while (1) {
size_t l = strlen(*p);
strcpy(r, *(p++));
if (!*p) break;
r += l;
*(r++) = ' ';
}
return result;
}
static char **lines(const char *str)
{
unsigned char *buf = (unsigned char *) strdup(str);
unsigned char *p = buf, *q;
char **result, **r;
size_t count = 0u;
while (*p == '\n') p++;
q = p;
if (*p) count++;
while (*p) {
if (*p == '\n') {
*(p++) = 0;
while (*p == '\n') *(p++) = 0;
if (*p) count++;
} else p++;
}
r = result = malloc((count+1)*sizeof(char *));
if (count) while (1) {
*(r++) = strdup((char *) q);
if (!--count) break;
while (*q) q++;
while (!*q) q++;
}
*r = NULL;
return result;
}
static char *unlines(char **arr)
{
size_t len = 0u;
char **p = arr, *result, *r;
while (*p)
len += strlen(*(p++)) + 1u;
if (!len) return calloc(1, 1);
r = result = malloc(len);
p = arr;
while (1) {
size_t l = strlen(*p);
strcpy(r, *(p++));
if (!*p) break;
r += l;
*(r++) = '\n';
}
return result;
}
static char *appLexer(GF_Lexer f, const char *str)
{
char **arr = f(str), **p = arr, *result;
int ofs = 0;
while (*p && **p) p++;
while (*p) {
if (**p) p[-ofs] = *p; else ofs++;
p++;
}
p[-ofs] = NULL;
result = unwords(arr);
freev(arr);
return result;
}
static char *appUnlexer(GF_Unlexer f, const char *str)
{
char **arr = lines(str), **p = arr, *result;
while (*p) {
char **warr = words(*p);
free(*p);
*(p++) = f(warr);
freev(warr);
}
result = unlines(arr);
freev(arr);
return result;
}
static inline int isPunct(char c)
{
return c && strchr(".?!,:;", c);
}
static inline int isMajorPunct(char c)
{
return c && strchr(".?!", c);
}
static inline int isMinorPunct(char c)
{
return c && strchr(",:;", c);
}
static char *charToStr(char c)
{
char *result = malloc(2), *p = result;
*(p++) = c;
*p = 0;
return result;
}
static char **lexChars(const char *str)
{
char **result = malloc((strlen(str)+1)*sizeof(char *)), **r = result;
const char *p = str;
while (*p) {
if (!isspace(*p)) *(r++) = charToStr(*p);
p++;
}
*r = NULL;
return result;
}
static char **lexText(const char *str)
{
char **result = malloc((strlen(str)+1)*sizeof(char *)), **r = result;
const char *p = str;
int uncap = 1;
while (*p) {
if (isMajorPunct(*p)) {
*(r++) = charToStr(*(p++));
uncap = 1;
} else if (isMinorPunct(*p)) {
*(r++) = charToStr(*(p++));
uncap = 0;
} else if (isspace(*p)) {
p++;
uncap = 0;
} else {
const char *q = p;
char *word;
size_t l;
while (*p && !isspace(*p) && !isPunct(*p)) p++;
l = p - q;
word = malloc(l + 1);
strncpy(word, q, l);
word[l] = 0;
if (uncap) *word = tolower(*word);
*(r++) = word;
uncap = 0;
}
}
*r = NULL;
return result;
}
static char *unlexText(char **arr)
{
size_t len = 0u;
char **p = arr, *result, *r;
int cap = 1;
while (*p)
len += strlen(*(p++)) + 1u;
if (!len) return calloc(1, 1);
r = result = malloc(len);
p = arr;
while (1) {
size_t l = strlen(*p);
char *word = *(p++);
if (*word == '"' && word[l-1] == '"') word++, l--;
strncpy(r, word, l);
if (cap) *r = toupper(*r);
if (!*p) break;
r += l;
if (isPunct(**p) && !(*p)[1]) {
*(r++) = **p;
if (!p[1]) break;
cap = isMajorPunct(**(p++));
} else cap = 0;
*(r++) = ' ';
}
*r = 0;
return result;
}
static char *stringop_chars(const char *str)
{
return appLexer(lexChars, str);
}
static char *stringop_lextext(const char *str)
{
return appLexer(lexText, str);
}
static char *stringop_words(const char *str)
{
return appLexer(words, str);
}
static char *stringop_unlextext(const char *str)
{
return appUnlexer(unlexText, str);
}
static char *stringop_unwords(const char *str)
{
return appUnlexer(unwords, str);
}
GF_StringOp gf_stringOp(const char *op)
{
if (!strcmp(op, "chars")) return stringop_chars;
if (!strcmp(op, "lextext")) return stringop_lextext;
if (!strcmp(op, "words")) return stringop_words;
if (!strcmp(op, "unlextext")) return stringop_unlextext;
if (!strcmp(op, "unwords")) return stringop_unwords;
return NULL;
}

View File

@@ -1,26 +0,0 @@
/* GF C Bindings
Copyright (C) 2010 Kevin Kofler
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/* Function pointer type which applies a string operation to str, which is
assumed to be non-NULL.
The resulting string can be assumed to be non-NULL and must be freed using
free. */
typedef char *(*GF_StringOp)(const char *str);
/* Returns a GF_StringOp applying the operation op if available, otherwise
NULL. op is assumed to be non-NULL. The GF_StringOp MUST NOT be freed. */
GF_StringOp gf_stringOp(const char *op);

View File

@@ -1,50 +0,0 @@
/* GF C Bindings
Copyright (C) 2008-2009 Kevin Kofler
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stdlib.h>
#include "pgf.h"
#include "gf_lexing.h"
int main(int argc, char *argv[])
{
gf_init(&argc, &argv);
GF_PGF pgf = gf_readPGF("Query.pgf");
GF_Language lang = gf_readLanguage("QueryEng");
GF_Type cat = gf_startCat(pgf);
char *lexed = gf_stringOp("lextext")("Is 2 prime");
// char *lexed = "is 23 odd";
GF_Tree *result = gf_parse(pgf, lang, cat, lexed);
free(lexed);
GF_Tree *p = result;
if (*p) {
do {
char *str = gf_showExpr(*(p++));
puts(str);
free(str);
} while (*p);
} else
puts("no match");
gf_freeTrees(result);
gf_freeType(cat);
gf_freeLanguage(lang);
gf_freePGF(pgf);
gf_exit();
return 0;
}

View File

@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@@ -1,504 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@@ -1,68 +0,0 @@
/* GF C Bindings
Copyright (C) 2008-2009 Kevin Kofler
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "HsFFI.h"
#ifdef __GLASGOW_HASKELL__
#include "PGFFFI_stub.h"
extern void __stginit_PGFFFI ( void );
#endif
static inline void gf_init(int *argc, char ***argv)
{
hs_init(argc, argv);
#ifdef __GLASGOW_HASKELL__
hs_add_root(__stginit_PGFFFI);
#endif
}
static inline void gf_exit(void)
{
hs_exit();
}
typedef HsStablePtr GF_PGF;
typedef HsStablePtr GF_CId;
typedef HsStablePtr GF_Language;
typedef HsStablePtr GF_Type;
typedef HsStablePtr GF_Tree;
typedef HsStablePtr GF_Expr;
static inline void gf_freeCIds(GF_CId *p)
{
GF_CId *q = p;
while (*q)
gf_freeCId(*(q++));
free(p);
}
static inline void gf_freeLanguages(GF_Language *p)
{
GF_Language *q = p;
while (*q)
gf_freeLanguage(*(q++));
free(p);
}
static inline void gf_freeTrees(GF_Tree *p)
{
GF_Type *q = p;
while (*q)
gf_freeTree(*(q++));
free(p);
}

View File

@@ -1,120 +0,0 @@
GF C Bindings
Copyright (C) 2008-2010 Kevin Kofler
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see <http://www.gnu.org/licenses/>.
This library provides access to the GF embedded grammars (PGF) API to C/C++
applications. To use it:
1. #include "pgf.h"
2. call gf_init(&argc, &argv); at the beginning of main()
3. call gf_exit(); before exiting the program
4. build with: ghc --make -fglasgow-exts -O2 -no-hs-main $* x.c PGFFFI.hs -o x
Currently, the following functions from PGF are wrapped:
readPGF :: FilePath -> IO PGF
mkCId :: String -> CId
wildCId :: CId
showCId :: CId -> String
readCId :: String -> Maybe CId
showLanguage :: Language -> String
readLanguage :: String -> Maybe Language
languages :: PGF -> [Language]
abstractName :: PGF -> Language
languageCode :: PGF -> Language -> Maybe String
showType :: Type -> [CId] -> String (*)
readType :: String -> Maybe Type
categories :: PGF -> [CId]
startCat :: PGF -> Type
showExpr :: Expr -> [CId] -> String (*)
readExpr :: String -> Maybe Expr
linearize :: PGF -> Language -> Tree -> String
showPrintName :: PGF -> Language -> CId -> String
parse :: PGF -> Language -> Type -> String -> [Tree]
(*) The [CId] parameter is currently not mapped; instead, [] is always passed.
Some notes about the wrapping:
* "gf_" is prepended to the wrapped functions as a form of namespacing.
* Object types T are mapped to opaque C types GF_T which are handles to the
object. Whenever returned by a function, they get marked as used (so the
Haskell garbage collection won't delete them), so when you are done using
them, you should free them (assuming they're non-NULL) with the corresponding
gf_freeT function (i.e. one of: gf_freePGF, gf_freeLanguage, gf_freeType,
gf_freeCId, gf_freeTree, gf_freeExpr). (Internally, they are all Haskell
StablePtr handles, but this is subject to change.)
* Strings are mapped to char *. Strings returned by functions, when not NULL,
are allocated with malloc and should thus be freed with free when no longer
needed.
* A FilePath is a string.
* A type Maybe T is mapped the same way as just T, except that the returned
handle or char * can be NULL, so you should test them with a test like if (p).
Otherwise functions can be expected to always return non-NULL
handles/pointers. Conversely, arguments to functions are always assumed to be
non-NULL.
* Lists [T] are mapped to null-terminated arrays GF_T[], passed/returned as
pointers GF_T *. All objects in the array should be freed with the correct
gf_freeT function when no longer needed, the array itself with free. For your
convenience, the C header defines inline functions gf_freeLanguages,
gf_freeTypes and gf_freeTrees which free an entire array.
* Bool is wrapped to int using the usual C convention of 1 = True, 0 = False.
* A constant like wildCId is mapped to a function with no arguments, e.g.
GF_CId wildCId(void). The returned handle has to be freed as for any other
function.
Thus, the C prototypes for the wrapped functions are:
GF_PGF *gf_readPGF(char *path);
GF_CId gf_mkCId(char *str);
GF_CId wildCId(void);
char *gf_showCId(GF_CID cid);
GF_CId gf_readCId(char *str); /* may return NULL */
char *gf_showLanguage(GF_Language lang);
GF_Language gf_readLanguage(char *str); /* may return NULL */
GF_Language *gf_languages(GF_PGF pgf);
GF_Language gf_abstractName(GF_PGF pgf);
char *gf_languageCode(GF_PGF pgf, GF_Language lang); /* may return NULL */
char *gf_showType(GF_Type tp);
GF_Type gf_readType(char *str); /* may return NULL */
GF_CId *gf_categories(GF_PGF pgf);
GF_Type gf_startCat(GF_PGF pgf);
char *gf_showExpr(GF_Expr expr);
GF_Expr gf_readExpr(char *str); /* may return NULL */
char *gf_linearize(GF_PGF pgf, GF_Language lang, GF_Tree tree);
char *gf_showPrintName(GF_PGF pgf, GF_Language lang, GF_CId cid);
GF_Tree *gf_parse(GF_PGF pgf, GF_Language lang, GF_Type cat, char *input);
The C prototypes for the freeing functions are:
void gf_freePGF(GF_PGF pgf);
void gf_freeCId(GF_CId cid);
void gf_freeLanguage(GF_Language lang);
void gf_freeType(GF_Type tp);
void gf_freeTree(GF_Tree tree);
void gf_freeExpr(GF_Expr expr);
void gf_freeCIds(GF_Type *p);
void gf_freeLanguages(GF_Language *p);
void gf_freeTrees(GF_Tree *p);
In addition, a C equivalent to the following function from GF.Text.Lexing:
stringOp :: String -> Maybe (String -> String)
is provided as:
typedef char *(*GF_StringOp)(const char *str);
GF_StringOp gf_stringOp(const char *op); /* may return NULL */
which returns NULL if op is not a valid operation name, otherwise a pointer to a
function which applies the function corresponding to op to the string str. The
resulting string must be freed with free. The function pointer MUST NOT be
freed.

View File

@@ -1,37 +0,0 @@
src=../../src
import=-i$(src)/runtime/haskell:$(src)/compiler
cbind=../c-bindings
pyversion = $(shell python -c 'import sys; print ".".join(`t` for t in sys.version_info[:2])')
pythoninc=/usr/include/python$(pyversion)
debug= #-optc '-DDEBUG=1'
exdir=../../examples/tutorial/embedded
build: gf.so
test:
python test.py
gf.so: PyGF.hs gfmodule.c Query.pgf
ghc $(import) --make -fglasgow-exts -O2 -no-hs-main -c $<
ghc -O2 --make -fglasgow-exts -no-hs-main -optl '-shared' \
-optc '-DMODULE=$(basename $<)' $(debug) -optc '-I$(pythoninc)' -o $@ \
$(filter-out %.pgf, $^)
clean:
rm -f *.hi *.o
rm -f *_stub.*
rm -f PyGF.hs
superclean:
make clean
rm -f Query.pgf
rm -f gf.so
rm -f mtest
PyGF.hs: PyGF.hsc
hsc2hs -I$(pythoninc) $<
Query.pgf:
gf --make $(exdir)/QueryEng.gf $(exdir)/QuerySpa.gf

View File

@@ -1,266 +0,0 @@
{-# LANGUAGE ForeignFunctionInterface #-}
-- GF Python bindings -- Jordi Saludes, upc.edu 2010
-- Jordi Saludes, upc.edu 2010
--
module PyGF where
import PGF
import Foreign
import CString
import Foreign.C.Types
import Control.Monad
#include "pygf.h"
freeSp :: String -> Ptr a -> IO ()
freeSp tname p = do
--DEBUG putStrLn $ "about to free pointer " ++ tname ++ " at " ++ (show p)
sp <- (#peek PyGF, sp) p
--DEBUG putStrLn "peeked"
freeStablePtr sp
--DEBUG putStrLn $ "freeing " ++ tname ++ " at " ++ (show p)
instance Storable PGF where
sizeOf _ = (#size PyGF)
alignment _ = alignment (undefined::CInt)
poke p o = do
sp <- newStablePtr o
(#poke PyGF, sp) p sp
peek p = do
sp <- (#peek PyGF, sp) p
deRefStablePtr sp
instance Storable Type where
sizeOf _ = (#size PyGF)
alignment _ = alignment (undefined::CInt)
poke p o = do
sp <- newStablePtr o
(#poke PyGF, sp) p sp
peek p = do
sp <- (#peek PyGF, sp) p
deRefStablePtr sp
instance Storable Language where
sizeOf _ = (#size PyGF)
alignment _ = alignment (undefined::CInt)
poke p o = do
sp <- newStablePtr o
(#poke PyGF, sp) p sp
peek p = do
sp <- (#peek PyGF, sp) p
deRefStablePtr sp
instance Storable Tree where
sizeOf _ = (#size PyGF)
alignment _ = alignment (undefined::CInt)
poke p o = do
sp <- newStablePtr o
(#poke PyGF, sp) p sp
peek p = do
sp <- (#peek PyGF, sp) p
deRefStablePtr sp
-- It is CId the same as Tree?
{- instance Storable CId where
sizeOf _ = (#size PyGF)
alignment _ = alignment (undefined::CInt)
poke p o = do
sp <- newStablePtr o
(#poke PyGF, sp) p sp
peek p = do
sp <- (#peek PyGF, sp) p
deRefStablePtr sp
-}
foreign export ccall gf_freePGF :: Ptr PGF -> IO ()
foreign export ccall gf_freeType :: Ptr Type -> IO ()
foreign export ccall gf_freeLanguage :: Ptr Language -> IO ()
foreign export ccall gf_freeTree :: Ptr Tree -> IO ()
foreign export ccall gf_freeExpr :: Ptr Expr -> IO ()
foreign export ccall gf_freeCId :: Ptr CId -> IO ()
gf_freePGF = freeSp "pgf"
gf_freeType = freeSp "type"
gf_freeLanguage = freeSp "language"
gf_freeTree = freeSp "tree"
gf_freeExpr = freeSp "expression"
gf_freeCId = freeSp "CId"
{-foreign export ccall gf_printCId :: Ptr CId-> IO CString
gf_printCId p = do
c <- peek p
newCString (showCId c)
-}
foreign export ccall gf_readPGF :: CString -> IO (Ptr PGF)
gf_readPGF path = do
ppgf <- pyPGF
p <- peekCString path
readPGF p >>= poke ppgf
return ppgf
foreign export ccall gf_readLanguage :: Ptr Language -> CString -> IO Bool
gf_readLanguage pt str = do
s <- (peekCString str)
case (readLanguage s) of
Just x -> do
poke pt x
return True
Nothing -> return False
foreign export ccall gf_startCat :: Ptr PGF -> IO (Ptr Type)
gf_startCat ppgf = do
pgf <- peek ppgf
pcat <- pyType
poke pcat (startCat pgf)
return pcat
foreign export ccall gf_parse :: Ptr PGF -> Ptr Language -> Ptr Type -> CString -> IO (Ptr ())
gf_parse ppgf plang pcat input = do
p <- peek ppgf
c <- peek pcat
i <- peekCString input
l <- peek plang
let parsed = parse p l c i
--DEBUG putStrLn $ (show $ length parsed) ++ " parsings"
listToPy pyTree parsed
foreign export ccall gf_showExpr :: Ptr Expr -> IO CString
gf_showExpr pexpr = do
e <- peek pexpr
newCString (showExpr [] e)
listToPy :: Storable a => IO (Ptr a) -> [a] -> IO (Ptr ()) -- opaque -- IO (Ptr (Ptr Language))
listToPy mk ls = do
pyls <- pyList
mapM_ (mpoke pyls) ls
return pyls
where mpoke pyl l = do
pl <- mk
poke pl l
pyl << pl
-- foreign export ccall "gf_freeArray" free :: Ptr a -> IO ()
foreign export ccall gf_showLanguage :: Ptr Language -> IO CString
gf_showLanguage plang = do
l <- peek plang
newCString $ showLanguage l
foreign export ccall gf_showType :: Ptr Type -> IO CString
gf_showType ptp = do
t <- peek ptp
newCString $ showType [] t
foreign export ccall gf_showPrintName :: Ptr PGF -> Ptr Language -> Ptr CId -> IO CString
gf_showPrintName ppgf plang pcid = do
pgf <- peek ppgf
lang <- peek plang
cid <- peek pcid
newCString (showPrintName pgf lang cid)
foreign export ccall gf_abstractName :: Ptr PGF -> IO (Ptr Language)
gf_abstractName ppgf = do
pabs <- pyLang
pgf <- peek ppgf
poke pabs $ abstractName pgf
return pabs
foreign export ccall gf_linearize :: Ptr PGF -> Ptr Language -> Ptr Tree -> IO CString
gf_linearize ppgf plang ptree = do
pgf <- peek ppgf
lang <- peek plang
tree <- peek ptree
newCString $ linearize pgf lang tree
foreign export ccall gf_languageCode :: Ptr PGF -> Ptr Language -> IO CString
gf_languageCode ppgf plang = do
pgf <- peek ppgf
lang <- peek plang
case languageCode pgf lang of
Just s -> newCString s
Nothing -> return nullPtr
foreign export ccall gf_languages :: Ptr PGF -> IO (Ptr ()) -- (Ptr (Ptr Language))
gf_languages ppgf = do
pgf <- peek ppgf
listToPy pyLang $ languages pgf
foreign export ccall gf_categories :: Ptr PGF -> IO (Ptr ())
gf_categories ppgf = do
pgf <- peek ppgf
listToPy pyCId $ categories pgf
foreign export ccall gf_showCId :: Ptr CId -> IO CString
gf_showCId pcid = do
cid <- peek pcid
newCString $ showCId cid
foreign export ccall gf_unapp :: Ptr Expr -> IO (Ptr ())
foreign export ccall gf_unint :: Ptr Expr -> IO CInt
foreign export ccall gf_unstr :: Ptr Expr -> IO CString
gf_unapp pexp = do
exp <- peek pexp
case unApp exp of
Just (f,args) -> do
puexp <- pyList
pf <- pyCId
poke pf f
puexp << pf
mapM_ (\e -> do
pe <- pyExpr
poke pe e
puexp << pe) args
return puexp
Nothing -> return nullPtr
gf_unint pexp = do
exp <- peek pexp
return $ fromIntegral $ case unInt exp of
Just n -> n
_ -> (-9)
gf_unstr pexp = do
exp <- peek pexp
case unStr exp of
Just s -> newCString s
_ -> return nullPtr
foreign export ccall gf_inferexpr :: Ptr PGF -> Ptr Expr -> IO (Ptr Type)
gf_inferexpr ppgf pexp = do
pgf <- peek ppgf
exp <- peek pexp
case inferExpr pgf exp of
Right (_,t) -> do
ptype <- pyType
poke ptype t
return ptype
Left _ -> return nullPtr
foreign export ccall gf_functions :: Ptr PGF -> IO (Ptr ())
gf_functions ppgf = do
pgf <- peek ppgf
listToPy pyCId $ functions pgf
foreign export ccall gf_functiontype :: Ptr PGF -> Ptr CId -> IO (Ptr Type)
gf_functiontype ppgf pcid = do
pgf <- peek ppgf
cid <- peek pcid
case functionType pgf cid of
Just t -> do
ptp <- pyType
poke ptp t
return ptp
_ -> return nullPtr
foreign import ccall "newLang" pyLang :: IO (Ptr Language)
foreign import ccall "newPGF" pyPGF :: IO (Ptr PGF)
foreign import ccall "newTree" pyTree :: IO (Ptr Tree)
foreign import ccall "newgfType" pyType :: IO (Ptr Type)
foreign import ccall "newCId" pyCId :: IO (Ptr CId)
foreign import ccall "newExpr" pyExpr :: IO (Ptr Expr)
foreign import ccall "newList" pyList :: IO (Ptr ())
foreign import ccall "append" (<<) :: Ptr () -> Ptr a -> IO ()

View File

@@ -1,314 +0,0 @@
// GF Python bindings
// Jordi Saludes, upc.edu 2010
//
#include <Python.h>
#include <sys/stat.h>
#include "pygf.h"
/* utilities */
int
checkType(void* obj, PyTypeObject* tp)
{
int isRight = PyObject_TypeCheck((PyObject*)obj, tp);
if (!isRight)
PyErr_Format(PyExc_TypeError, "Expecting a %s.", tp->tp_doc);
return isRight;
}
/* new types and declarations */
NEWGF(CId,GF_CId,CIdType,"gf.cid","identifier")
NEWGF(Lang,GF_Language,LangType,"gf.lang","language")
NEWGF(gfType,GF_Type,gfTypeType,"gf.type","gf type")
NEWGF(PGF,GF_PGF,PGFType,"gf.pgf","PGF module")
NEWGF(Expr,GF_Expr,ExprType,"gf.expr","gf expression")
NEWGF(Tree,GF_Tree,TreeType,"gf.tree","gf tree")
/* CId methods, constructor and destructor */
DEALLOCFN(CId_dealloc, CId, gf_freeCId, "freeCId")
/* PGF methods, constructor and destructor */
DEALLOCFN(PGF_dealloc, PGF, gf_freePGF, "freePGF")
static PyObject*
pgf_repr(PGF *self) {
Lang* lang = gf_abstractName(self);
char* abs = gf_showLanguage(lang);
Py_DECREF(lang);
PyObject* str = PyString_FromFormat("<gf.pgf with abstract %s>", abs);
free(abs);
return str;
}
static PyObject*
languageCode(PGF *self, PyObject *args)
{
Lang *lang;
if (!PyArg_ParseTuple(args, "O", &lang))
return NULL;
if (!checkType(lang, &LangType)) return NULL;
char* scode = gf_languageCode(self, lang);
if (scode) {
PyObject* result = PyString_FromString(scode);
free(scode);
return result;
} else {
Py_INCREF(Py_None);
return Py_None;
}
}
static PyObject*
linearize(PGF *self, PyObject *args)
{
Lang *lang;
Tree *tree;
if (!PyArg_ParseTuple(args, "OO", &lang, &tree))
return NULL;
if (!checkType(lang,&LangType)) return NULL;
if (!checkType(tree,&TreeType)) return NULL;
char* c_lin = gf_linearize(self, lang, tree);
PyObject* lin = PyString_FromString(c_lin);
free(c_lin);
return lin;
}
static Lang*
abstractName(PGF *self)
{
if (!checkType(self,&PGFType)) return NULL;
return gf_abstractName(self);
}
static PyObject*
printName(PGF *self, PyObject *args)
{
Lang* lang;
CId* id;
if (!PyArg_ParseTuple(args, "OO", &lang, &id))
return NULL;
if (!checkType(lang,&LangType)) return NULL;
if (!checkType(id,&CIdType)) return NULL;
char *pname = gf_showPrintName(self, lang, id);
PyObject* result = PyString_FromString(pname);
free(pname);
return result;
}
static gfType*
functiontype(PGF *self, PyObject* args)
{
CId* cid;
gfType* gftp;
if (!PyArg_ParseTuple(args, "O", &cid))
return NULL;
if (!checkType(cid,&CIdType)) {
PyErr_Format(PyExc_TypeError, "Must be a gf identifier.");
return NULL;
}
return gf_functiontype(self, cid);
}
static PyObject*
parse(PGF *self, PyObject *args, PyObject *kws)
{
Lang *lang;
gfType *cat = NULL;
char *lexed;
static char *kwlist[] = {"lexed", "lang", "cat", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kws, "sO|O", kwlist,
&lexed, &lang, &cat))
return NULL;
if (!checkType(self, &PGFType)) return NULL;
if (!checkType(lang, &LangType)) return NULL;
if (cat) {
if (!checkType(cat, &gfTypeType)) return NULL;
} else {
cat = gf_startCat(self);
}
return gf_parse(self, lang, cat, lexed);
}
static PGF*
readPGF(PyObject *self, PyObject *args)
{
char *path;
struct stat info;
if (!PyArg_ParseTuple(args, "s", &path))
return NULL;
if (stat(path, &info) == 0) {
PGF* pgf = gf_readPGF(path);
return pgf;
} else {
PyErr_Format(PyExc_IOError, "No such file: %s", path);
return NULL;
}
}
static PyMethodDef pgf_methods[] = {
{"parse", (PyCFunction)parse, METH_VARARGS|METH_KEYWORDS,"Parse a string."},
{"lin", (PyCFunction)linearize, METH_VARARGS,"Linearize tree."},
{"lang_code", (PyCFunction)languageCode, METH_VARARGS,"Get the language code."},
{"print_name", (PyCFunction)printName, METH_VARARGS,"Get the print name for a id."},
{"fun_type", (PyCFunction)functiontype, METH_VARARGS,"Get the type of a fun expression."},
{"startcat", (PyCFunction)gf_startCat, METH_NOARGS,"Get the start category."},
{"categories", (PyCFunction)gf_categories, METH_NOARGS,"Get all categories."},
{"functions", (PyCFunction)gf_functions, METH_NOARGS,"Get all functions."},
{"abstract", (PyCFunction)abstractName, METH_NOARGS,"Get the module abstract name."},
{"languages", (PyCFunction)gf_languages, METH_NOARGS,"Get the module languages."},
{NULL, NULL, 0, NULL} /* Sentinel */
};
REPRCB(CId_repr, CId, gf_showCId)
/* Language methods, constructor and destructor */
REPRCB(lang_repr, Lang, gf_showLanguage)
DEALLOCFN(Lang_dealloc, Lang, gf_freeLanguage, "freeLanguage")
static Lang*
readLang(PyObject *self, PyObject *args)
{
char *langName;
Lang *l;
if (!PyArg_ParseTuple(args,"s",&langName))
return NULL;
l = (Lang*)LangType.tp_new(&LangType,NULL,NULL);
if(!l) return NULL;
gf_readLanguage(l,langName);
return l;
}
/* gf types: methods, constructor and destructor */
DEALLOCFN(gfType_dealloc, gfType, gf_freeType, "freeType")
REPRCB(gfType_repr, gfType, gf_showType)
/* expression type: methods, destructor */
DEALLOCFN(expr_dealloc, Expr, gf_freeExpr, "freeExpr")
REPRCB(expr_repr, Expr, gf_showExpr)
static PyObject*
unapp(Expr *self) {
PyObject* obj = gf_unapp(self);
if (!obj) {
char* s = gf_unstr(self);
if (s) {
obj = PyString_FromString(s);
free(s);
} else {
long n = gf_unint(self);
if (n != -9) {
obj = PyInt_FromLong(n);
} else {
PyErr_Format(PyExc_TypeError, "Cannot unapply expr.");
}
}
}
return obj;
}
static PyObject*
infer_expr(Expr *self, PyObject* args) {
PGF* pgf;
if (!PyArg_ParseTuple(args, "O", &pgf))
return NULL;
if (!checkType(pgf, &PGFType)) {
PyErr_Format(PyExc_ValueError, "Must be a pgf module.");
return NULL;
}
return gf_inferexpr(pgf, self);
}
/* todo: Is Tree == Expr ? */
static PyMethodDef expr_methods[] = {
{"unapply", (PyCFunction)unapp, METH_NOARGS, "Unapply an expression."},
{"infer", (PyCFunction)infer_expr, METH_VARARGS, "Infer the type of an expression."},
{NULL, NULL, 0, NULL} /* Sentinel */
};
/* tree typr: methods, constructor and destructor */
// Are Expr and Tree equivalent ?
REPRCB(tree_repr, Tree, gf_showExpr)
DEALLOCFN(Tree_dealloc, Tree, gf_freeTree, "freeTree")
/* gf module methods */
static PyMethodDef gf_methods[] = {
{"read_pgf", (PyCFunction)readPGF, METH_VARARGS,"Read pgf file."},
{"read_language", (PyCFunction)readLang, METH_VARARGS,"Get the language."},
{NULL, NULL, 0, NULL} /* Sentinel */
};
#ifndef PyMODINIT_FUNC/* declarations for DLL import/export */
#define PyMODINIT_FUNC void
#endif
PyMODINIT_FUNC
initgf(void)
{
PyObject* m;
#define READYTYPE(t,trepr,tdealloc) t.tp_new = PyType_GenericNew; \
t.tp_repr = (reprfunc)trepr; \
t.tp_dealloc = (destructor)tdealloc; \
if (PyType_Ready(&t) < 0) return;
READYTYPE(CIdType, CId_repr, CId_dealloc)
PGFType.tp_methods = pgf_methods;
READYTYPE(PGFType, pgf_repr, PGF_dealloc)
READYTYPE(LangType, lang_repr, Lang_dealloc)
READYTYPE(gfTypeType, gfType_repr, gfType_dealloc)
ExprType.tp_methods = expr_methods;
READYTYPE(ExprType, expr_repr, expr_dealloc)
TreeType.tp_methods = expr_methods; // Tree == Expr ?
READYTYPE(TreeType, tree_repr, Tree_dealloc)
m = Py_InitModule3("gf", gf_methods,
"Grammatical Framework.");
static char *argv[] = {"gf.so", 0}, **argv_ = argv;
static int argc = 1;
gf_init (&argc, &argv_);
hs_add_root (__stginit_PyGF);
#define ADDTYPE(t) Py_INCREF(&t);\
PyModule_AddObject(m, "gf", (PyObject *)&t);
ADDTYPE(PGFType)
ADDTYPE(LangType)
ADDTYPE(gfTypeType)
ADDTYPE(TreeType)
ADDTYPE(ExprType)
}
/* List utilities to be imported by FFI */
inline PyObject* newList() { return PyList_New(0); }
inline void append(PyObject* l, PyObject* ob) { PyList_Append(l, ob); }

View File

@@ -1,165 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@@ -1,96 +0,0 @@
#include <Python.h>
#include "HsFFI.h"
#ifdef __GLASGOW_HASKELL__
#include "PyGF_stub.h"
extern void __stginit_PyGF ( void );
#endif
static inline void gf_init(int *argc, char ***argv)
{
hs_init(argc, argv);
#ifdef __GLASGOW_HASKELL__
hs_add_root(__stginit_PyGF);
#endif
}
static inline void gf_exit(void)
{
hs_exit();
}
typedef HsStablePtr GF_PGF;
typedef HsStablePtr GF_CId;
typedef HsStablePtr GF_Language;
typedef HsStablePtr GF_Type;
typedef HsStablePtr GF_Tree;
typedef HsStablePtr GF_Expr;
typedef struct {
PyObject_HEAD;
HsStablePtr sp;
} PyGF;
#define NEWOBJECT(OBJ, GFTYPE) typedef struct {\
PyObject_HEAD \
GFTYPE obj; \
} OBJ;
#define PYTYPE(OBJ) OBJ ## Type
#define NEWCONSTRUCTOR(OBJ) inline OBJ* new ## OBJ () {\
return (OBJ*)PYTYPE(OBJ).tp_new(&PYTYPE(OBJ),NULL,NULL); }
#define NEWTYPE(TYPE,NAME,OBJECT,DOC) static PyTypeObject TYPE = {\
PyObject_HEAD_INIT(NULL)\
0, /*ob_size*/\
NAME, /*tp_name*/\
sizeof(OBJECT), /*tp_basicsize*/\
0, /*tp_itemsize*/\
0, /*tp_dealloc*/\
0, /*tp_print*/\
0, /*tp_getattr*/\
0, /*tp_setattr*/\
0, /*tp_compare*/\
0, /*tp_repr*/\
0, /*tp_as_number*/\
0, /*tp_as_sequence*/\
0, /*tp_as_mapping*/\
0, /*tp_hash */\
0, /*tp_call*/\
0, /*tp_str*/\
0, /*tp_getattro*/\
0, /*tp_setattro*/\
0, /*tp_as_buffer*/\
Py_TPFLAGS_DEFAULT, /*tp_flags*/\
DOC, /* tp_doc */\
};
#define NEWGF(OBJ,GFTYPE,TYPE,NAME,DOC) NEWOBJECT(OBJ,GFTYPE) \
NEWTYPE(TYPE,NAME,OBJ,DOC)\
NEWCONSTRUCTOR(OBJ)
// NEWOBJECT(CID, GF_CId)
#ifdef DEBUG
#define DEALLOCFN(delname,t,cb,cbname) static void \
delname(t *self){ cb(self);\
printf("gf_%s has been called for stable pointer 0x%x\n", cbname, self->obj);\
self->ob_type->tp_free((PyObject*)self); }
#else
#define DEALLOCFN(delname,t,cb,cbname) static void \
delname(t *self){ cb(self);\
self->ob_type->tp_free((PyObject*)self); }
#endif
#ifdef DEBUG
#define REPRCB(cbid,t,gfcb) static PyObject* \
cbid(t *self) { \
const char *str = gfcb(self); \
return PyString_FromFormat("0x%x: %s", self->obj, str); }
#else
#define REPRCB(cbid,t,gfcb) static PyObject* \
cbid(t *self) { \
const char *str = gfcb(self); \
return PyString_FromString(str); }
#endif

View File

@@ -1,167 +0,0 @@
#!/usr/bin/env python
# GF Python bindings
# Jordi Saludes 2010
#
import gf
import unittest
samples = [
(['Odd', ['Number', 89]],
{'eng': "is 89 odd",
'spa': "89 es impar"}),
(['Prime', ['Number', 21]],
{'eng': "is 21 prime",
'spa': "21 es primo"})]
def lang2iso(l):
s = rmprefix(l)
assert s[:5]=="Query"
return s[5:].lower()
def exp2str(e):
def e2s(e,n):
if type(e) == type([2]):
f = e[0]
sr = ' '.join([e2s(arg,n+1) for arg in e[1:]])
ret =f + ' ' + sr
return n and '('+ret+')' or ret
elif type(e) == type('2'):
return e
elif type(e) == type(2):
return `e`
else:
raise ValueError, "Do not know how to render " + `e`
return e2s(e,0)
import re
hexre = re.compile('0x[0-9a-f]+:[ ]*')
def rmprefix(obj):
return `obj`
# s = `obj`
# m = hexre.match(s)
# return m and s[m.end(0):]
class TestPgfInfo(unittest.TestCase):
def pgf(self, path=None):
path = path or self.path
return gf.read_pgf(path)
def setUp(self):
self.path = 'Query.pgf'
def test_readPgf(self):
pgf = self.pgf()
self.assertNotEqual(pgf,None)
def test_readNonExistent(self):
nopath = 'x' + self.path
self.assertRaises(IOError, self.pgf, nopath)
def test_startcat(self):
pgf = self.pgf()
cat = pgf.startcat()
self.assertEqual(rmprefix(cat),'Question')
def test_categories(self):
pgf = self.pgf()
cats = [`c` for c in pgf.categories()]
self.failUnless('Float' in cats)
self.failUnless('Int' in cats)
self.failUnless('String' in cats)
def test_createLanguage(self):
pgf = self.pgf()
for lang in 'QueryEng QuerySpa'.split():
l = gf.read_language(lang)
self.assertEqual(rmprefix(l),lang)
def test_functions(self):
pgf = self.pgf()
self.assertTrue('Even' in [`f` for f in pgf.functions()])
def test_function_types(self):
pgf = self.pgf()
gftypes = dict((`f`,`pgf.fun_type(f)`) for f in pgf.functions())
for p in "Prime : Object -> Question; Yes : Answer".split(';'):
lhs,rhs = [s.strip() for s in p.split(':')]
self.assertEqual(gftypes[lhs],rhs)
class TestParsing(unittest.TestCase):
def setUp(self):
self.lexed = samples
self.lang = 'QueryEng'
self.pgf = "Query.pgf"
def test_parse(self):
pgf = gf.read_pgf(self.pgf)
l = gf.read_language(self.lang)
for abs,cnc in self.lexed:
rabs = exp2str(abs)
ps = pgf.parse(cnc['eng'], l)
self.failUnless(ps)
pt = rmprefix(ps[0])
self.assertEqual(pt,rabs)
class TestLinearize(unittest.TestCase):
def setUp(self):
self.samples = samples
self.pgf = gf.read_pgf('Query.pgf')
self.lang = gf.read_language('QueryEng')
def test_Linearize(self):
l = self.lang
for abs,cnc in self.samples:
ts = self.pgf.parse(cnc['eng'], l)
self.assertEqual(cnc['eng'],self.pgf.lin(l,ts[0]))
class TestTranslate(unittest.TestCase):
def setUp(self):
self.samples = samples
self.pgf = gf.read_pgf('Query.pgf')
self.langs = [(lang2iso(l),l) for l in self.pgf.languages()]
def test_translate(self):
for abs,cnc in self.samples:
for i,l in self.langs:
for j,m in self.langs:
if i==j: continue
parsed = self.pgf.parse(cnc[i],l)
assert len(parsed) == 1
lin = self.pgf.lin(m,parsed[0])
self.assertEqual(lin,cnc[j])
class TestUnapplyExpr(unittest.TestCase):
def setUp(self):
self.samples = samples
self.pgf = gf.read_pgf('Query.pgf')
self.langs = dict([(lang2iso(l),l) for l in self.pgf.languages()])
def deep_unapp(self,exp):
exp = exp.unapply()
if type(exp) == type([2]):
f = exp[0]
return [`f`] + map(self.deep_unapp,exp[1:])
else:
return exp
def test_unapply(self):
lg = 'eng'
lang = self.langs[lg]
for abs,cnc in self.samples:
parsed = self.pgf.parse(cnc[lg],lang)
uparsed = self.deep_unapp(parsed[0])
self.assertEqual(abs,uparsed)
def test_infer(self):
lg = 'eng'
lang = self.langs[lg]
cnc = self.samples[0][1]
parsed = self.pgf.parse(cnc[lg],lang)
exp = parsed[0]
for t in 'Question Object Int'.split():
self.assertEqual(`exp.infer(self.pgf)`, t)
uexp = exp.unapply()
if type(uexp) != type(2) and type(uexp) != type('2'):
exp = uexp[1]
if __name__ == '__main__':
unittest.main()

View File

@@ -1,15 +0,0 @@
-- (c) 2009 Aarne Ranta under LGPL
abstract Foods = {
flags startcat = Comment ;
cat
Comment ; Item ; Kind ; Quality ;
fun
Pred : Item -> Quality -> Comment ;
This, That, These, Those : Kind -> Item ;
Mod : Quality -> Kind -> Kind ;
Wine, Cheese, Fish, Pizza : Kind ;
Very : Quality -> Quality ;
Fresh, Warm, Italian,
Expensive, Delicious, Boring : Quality ;
}

View File

@@ -1,76 +0,0 @@
-- (c) 2009 Laurette Pretorius Sr & Jr and Ansu Berg under LGPL
concrete FoodsAfr of Foods = open Prelude, Predef in{
lincat
Comment = {s: Str} ;
Kind = {s: Number => Str} ;
Item = {s: Str ; n: Number} ;
Quality = {s: AdjAP => Str} ;
lin
Pred item quality = {s = item.s ++ "is" ++ (quality.s ! Predic)};
This kind = {s = "hierdie" ++ (kind.s ! Sg); n = Sg};
That kind = {s = "daardie" ++ (kind.s ! Sg); n = Sg};
These kind = {s = "hierdie" ++ (kind.s ! Pl); n = Pl};
Those kind = {s = "daardie" ++ (kind.s ! Pl); n = Pl};
Mod quality kind = {s = table{n => (quality.s ! Attr) ++ (kind.s!n)}};
Wine = declNoun_e "wyn";
Cheese = declNoun_aa "kaas";
Fish = declNoun_ss "vis";
Pizza = declNoun_s "pizza";
Very quality = veryAdj quality;
Fresh = regAdj "vars";
Warm = regAdj "warm";
Italian = smartAdj_e "Italiaans";
Expensive = regAdj "duur";
Delicious = smartAdj_e "heerlik";
Boring = smartAdj_e "vervelig";
param
AdjAP = Attr | Predic ;
Number = Sg | Pl ;
oper
--Noun operations (wyn, kaas, vis, pizza)
declNoun_aa: Str -> {s: Number => Str} = \x ->
let v = tk 2 x
in
{s = table{Sg => x ; Pl => v + (last x) +"e"}};
declNoun_e: Str -> {s: Number => Str} = \x -> {s = table{Sg => x ; Pl => x + "e"}} ;
declNoun_s: Str -> {s: Number => Str} = \x -> {s = table{Sg => x ; Pl => x + "s"}} ;
declNoun_ss: Str -> {s: Number => Str} = \x -> {s = table{Sg => x ; Pl => x + (last x) + "e"}} ;
--Adjective operations
mkAdj : Str -> Str -> {s: AdjAP => Str} = \x,y -> {s = table{Attr => x; Predic => y}};
declAdj_e : Str -> {s : AdjAP=> Str} = \x -> mkAdj (x + "e") x;
declAdj_g : Str -> {s : AdjAP=> Str} = \w ->
let v = init w
in mkAdj (v + "ë") w ;
declAdj_oog : Str -> {s : AdjAP=> Str} = \w ->
let v = init w
in
let i = init v
in mkAdj (i + "ë") w ;
regAdj : Str -> {s : AdjAP=> Str} = \x -> mkAdj x x;
veryAdj : {s: AdjAP => Str} -> {s : AdjAP=> Str} = \x -> {s = table{a => "baie" ++ (x.s!a)}};
smartAdj_e : Str -> {s : AdjAP=> Str} = \a -> case a of
{
_ + "oog" => declAdj_oog a ;
_ + ("e" | "ie" | "o" | "oe") + "g" => declAdj_g a ;
_ => declAdj_e a
};
}

View File

@@ -1,21 +0,0 @@
concrete FoodsAmh of Foods ={
flags coding = utf8;
lincat
Comment,Item,Kind,Quality = Str;
lin
Pred item quality = item ++ quality++ "ነው::" ;
This kind = "ይህ" ++ kind;
That kind = "ያ" ++ kind;
Mod quality kind = quality ++ kind;
Wine = "ወይን";
Cheese = "አይብ";
Fish = "ዓሳ";
Very quality = "በጣም" ++ quality;
Fresh = "አዲስ";
Warm = "ትኩስ";
Italian = "የጥልያን";
Expensive = "ውድ";
Delicious = "ጣፋጭ";
Boring = "አስቀያሚ";
}

View File

@@ -1,43 +0,0 @@
-- (c) 2009 Krasimir Angelov under LGPL
concrete FoodsBul of Foods = {
flags
coding = utf8;
param
Gender = Masc | Fem | Neutr;
Number = Sg | Pl;
Agr = ASg Gender | APl ;
lincat
Comment = Str ;
Quality = {s : Agr => Str} ;
Item = {s : Str; a : Agr} ;
Kind = {s : Number => Str; g : Gender} ;
lin
Pred item qual = item.s ++ case item.a of {ASg _ => "е"; APl => "са"} ++ qual.s ! item.a ;
This kind = {s=case kind.g of {Masc=>"този"; Fem=>"тази"; Neutr=>"това" } ++ kind.s ! Sg; a=ASg kind.g} ;
That kind = {s=case kind.g of {Masc=>"онзи"; Fem=>"онази"; Neutr=>"онова"} ++ kind.s ! Sg; a=ASg kind.g} ;
These kind = {s="тези" ++ kind.s ! Pl; a=APl} ;
Those kind = {s="онези" ++ kind.s ! Pl; a=APl} ;
Mod qual kind = {s=\\n => qual.s ! (case n of {Sg => ASg kind.g; Pl => APl}) ++ kind.s ! n; g=kind.g} ;
Wine = {s = table {Sg => "вино"; Pl => "вина"}; g = Neutr};
Cheese = {s = table {Sg => "сирене"; Pl => "сирена"}; g = Neutr};
Fish = {s = table {Sg => "риба"; Pl => "риби"}; g = Fem};
Pizza = {s = table {Sg => "пица"; Pl => "пици"}; g = Fem};
Very qual = {s = \\g => "много" ++ qual.s ! g};
Fresh = {s = table {ASg Masc => "свеж"; ASg Fem => "свежа"; ASg Neutr => "свежо"; APl => "свежи"}};
Warm = {s = table {ASg Masc => "горещ"; ASg Fem => "гореща"; ASg Neutr => "горещо"; APl => "горещи"}};
Italian = {s = table {ASg Masc => "италиански"; ASg Fem => "италианска"; ASg Neutr => "италианско"; APl => "италиански"}};
Expensive = {s = table {ASg Masc => "скъп"; ASg Fem => "скъпа"; ASg Neutr => "скъпо"; APl => "скъпи"}};
Delicious = {s = table {ASg Masc => "превъзходен"; ASg Fem => "превъзходна"; ASg Neutr => "превъзходно"; APl => "превъзходни"}};
Boring = {s = table {ASg Masc => "еднообразен"; ASg Fem => "еднообразна"; ASg Neutr => "еднообразно"; APl => "еднообразни"}};
}

View File

@@ -1,7 +0,0 @@
--# -path=.:present
-- (c) 2009 Jordi Saludes under LGPL
concrete FoodsCat of Foods = FoodsI with
(Syntax = SyntaxCat),
(LexFoods = LexFoodsCat) ;

View File

@@ -1,58 +0,0 @@
-- (c) 2009 Femke Johansson under LGPL
concrete FoodsDut of Foods = {
lincat
Comment = {s : Str};
Quality = {s : AForm => Str};
Kind = { s : Number => Str};
Item = {s : Str ; n : Number};
lin
Pred item quality =
{s = item.s ++ copula ! item.n ++ quality.s ! APred};
This = det Sg "deze";
These = det Pl "deze";
That = det Sg "die";
Those = det Pl "die";
Mod quality kind =
{s = \\n => quality.s ! AAttr ++ kind.s ! n};
Wine = regNoun "wijn";
Cheese = noun "kaas" "kazen";
Fish = noun "vis" "vissen";
Pizza = noun "pizza" "pizza's";
Very a = {s = \\f => "erg" ++ a.s ! f};
Fresh = regadj "vers";
Warm = regadj "warm";
Italian = regadj "Italiaans";
Expensive = adj "duur" "dure";
Delicious = regadj "lekker";
Boring = regadj "saai";
param
Number = Sg | Pl;
AForm = APred | AAttr;
oper
det : Number -> Str ->
{s : Number => Str} -> {s : Str ; n: Number} =
\n,det,noun -> {s = det ++ noun.s ! n ; n=n};
noun : Str -> Str -> {s : Number => Str} =
\man,men -> {s = table {Sg => man; Pl => men}};
regNoun : Str -> {s : Number => Str} =
\wijn -> noun wijn (wijn + "en");
regadj : Str -> {s : AForm => Str} =
\koud -> adj koud (koud+"e");
adj : Str -> Str -> {s : AForm => Str} =
\duur, dure -> {s = table {APred => duur; AAttr => dure}};
copula : Number => Str =
table {Sg => "is" ; Pl => "zijn"};
}

View File

@@ -1,43 +0,0 @@
-- (c) 2009 Aarne Ranta under LGPL
concrete FoodsEng of Foods = {
flags language = en_US;
lincat
Comment, Quality = {s : Str} ;
Kind = {s : Number => Str} ;
Item = {s : Str ; n : Number} ;
lin
Pred item quality =
{s = item.s ++ copula ! item.n ++ quality.s} ;
This = det Sg "this" ;
That = det Sg "that" ;
These = det Pl "these" ;
Those = det Pl "those" ;
Mod quality kind =
{s = \\n => quality.s ++ kind.s ! n} ;
Wine = regNoun "wine" ;
Cheese = regNoun "cheese" ;
Fish = noun "fish" "fish" ;
Pizza = regNoun "pizza" ;
Very a = {s = "very" ++ a.s} ;
Fresh = adj "fresh" ;
Warm = adj "warm" ;
Italian = adj "Italian" ;
Expensive = adj "expensive" ;
Delicious = adj "delicious" ;
Boring = adj "boring" ;
param
Number = Sg | Pl ;
oper
det : Number -> Str ->
{s : Number => Str} -> {s : Str ; n : Number} =
\n,det,noun -> {s = det ++ noun.s ! n ; n = n} ;
noun : Str -> Str -> {s : Number => Str} =
\man,men -> {s = table {Sg => man ; Pl => men}} ;
regNoun : Str -> {s : Number => Str} =
\car -> noun car (car + "s") ;
adj : Str -> {s : Str} =
\cold -> {s = cold} ;
copula : Number => Str =
table {Sg => "is" ; Pl => "are"} ;
}

View File

@@ -1,48 +0,0 @@
-- (c) 2009 Julia Hammar under LGPL
concrete FoodsEpo of Foods = open Prelude in {
flags coding =utf8 ;
lincat
Comment = SS ;
Kind, Quality = {s : Number => Str} ;
Item = {s : Str ; n : Number} ;
lin
Pred item quality = ss (item.s ++ copula ! item.n ++ quality.s ! item.n) ;
This = det Sg "ĉi tiu" ;
That = det Sg "tiu" ;
These = det Pl "ĉi tiuj" ;
Those = det Pl "tiuj" ;
Mod quality kind = {s = \\n => quality.s ! n ++ kind.s ! n} ;
Wine = regNoun "vino" ;
Cheese = regNoun "fromaĝo" ;
Fish = regNoun "fiŝo" ;
Pizza = regNoun "pico" ;
Very quality = {s = \\n => "tre" ++ quality.s ! n} ;
Fresh = regAdj "freŝa" ;
Warm = regAdj "varma" ;
Italian = regAdj "itala" ;
Expensive = regAdj "altekosta" ;
Delicious = regAdj "bongusta" ;
Boring = regAdj "enuiga" ;
param
Number = Sg | Pl ;
oper
det : Number -> Str -> {s : Number => Str} -> {s : Str ; n : Number} =
\n,d,cn -> {
s = d ++ cn.s ! n ;
n = n
} ;
regNoun : Str -> {s : Number => Str} =
\vino -> {s = table {Sg => vino ; Pl => vino + "j"}
} ;
regAdj : Str -> {s : Number => Str} =
\nova -> {s = table {Sg => nova ; Pl => nova + "j"}
} ;
copula : Number => Str = \\_ => "estas" ;
}

View File

@@ -1,7 +0,0 @@
--# -path=.:present
-- (c) 2009 Aarne Ranta under LGPL
concrete FoodsFin of Foods = FoodsI with
(Syntax = SyntaxFin),
(LexFoods = LexFoodsFin) ;

View File

@@ -1,7 +0,0 @@
--# -path=.:present
-- (c) 2009 Aarne Ranta under LGPL
concrete FoodsGer of Foods = FoodsI with
(Syntax = SyntaxGer),
(LexFoods = LexFoodsGer) ;

View File

@@ -1,108 +0,0 @@
--# -path=alltenses
--(c) 2009 Dana Dannells
-- Licensed under LGPL
concrete FoodsHeb of Foods = open Prelude in {
flags coding=utf8 ;
lincat
Comment = SS ;
Quality = {s: Number => Species => Gender => Str} ;
Kind = {s : Number => Species => Str ; g : Gender ; mod : Modified} ;
Item = {s : Str ; g : Gender ; n : Number ; sp : Species ; mod : Modified} ;
lin
Pred item quality = ss (item.s ++ quality.s ! item.n ! Indef ! item.g ) ;
This = det Sg Def "הזה" "הזאת";
That = det Sg Def "ההוא" "ההיא" ;
These = det Pl Def "האלה" "האלה" ;
Those = det Pl Def "ההם" "ההן" ;
Mod quality kind = {
s = \\n,sp => kind.s ! n ! sp ++ quality.s ! n ! sp ! kind.g;
g = kind.g ;
mod = T
} ;
Wine = regNoun "יין" "יינות" Masc ;
Cheese = regNoun "גבינה" "גבינות" Fem ;
Fish = regNoun "דג" "דגים" Masc ;
Pizza = regNoun "פיצה" "פיצות" Fem ;
Very qual = {s = \\g,n,sp => "מאוד" ++ qual.s ! g ! n ! sp} ;
Fresh = regAdj "טרי" ;
Warm = regAdj "חם" ;
Italian = regAdj2 "איטלקי" ;
Expensive = regAdj "יקר" ;
Delicious = regAdj "טעים" ;
Boring = regAdj2 "משעמם";
param
Number = Sg | Pl ;
Gender = Masc | Fem ;
Species = Def | Indef ;
Modified = T | F ;
oper
Noun : Type = {s : Number => Species => Str ; g : Gender ; mod : Modified } ;
Adj : Type = {s : Number => Species => Gender => Str} ;
det : Number -> Species -> Str -> Str -> Noun ->
{s : Str ; g :Gender ; n : Number ; sp : Species ; mod : Modified} =
\n,sp,m,f,cn -> {
s = case cn.mod of { _ => cn.s ! n ! sp ++ case cn.g of {Masc => m ; Fem => f} };
g = cn.g ;
n = n ;
sp = sp ;
mod = cn.mod
} ;
noun : (gvina,hagvina,gvinot,hagvinot : Str) -> Gender -> Noun =
\gvina,hagvina,gvinot,hagvinot,g -> {
s = table {
Sg => table {
Indef => gvina ;
Def => hagvina
} ;
Pl => table {
Indef => gvinot ;
Def => hagvinot
}
} ;
g = g ;
mod = F
} ;
regNoun : Str -> Str -> Gender -> Noun =
\gvina,gvinot, g ->
noun gvina (defH gvina) gvinot (defH gvinot) g ;
defH : Str -> Str = \cn ->
case cn of {_ => "ה" + cn};
replaceLastLetter : Str -> Str = \c ->
case c of {"ף" => "פ" ; "ם" => "מ" ; "ן" => "נ" ; "ץ" => "צ" ; "ך" => "כ"; _ => c} ;
adjective : (_,_,_,_ : Str) -> Adj =
\tov,tova,tovim,tovot -> {
s = table {
Sg => table {
Indef => table { Masc => tov ; Fem => tova } ;
Def => table { Masc => defH tov ; Fem => defH tova }
} ;
Pl => table {
Indef => table {Masc => tovim ; Fem => tovot } ;
Def => table { Masc => defH tovim ; Fem => defH tovot }
}
}
} ;
regAdj : Str -> Adj = \tov ->
case tov of { to + c@? =>
adjective tov (to + replaceLastLetter (c) + "ה" ) (to + replaceLastLetter (c) +"ים" ) (to + replaceLastLetter (c) + "ות" )};
regAdj2 : Str -> Adj = \italki ->
case italki of { italk+ c@? =>
adjective italki (italk + replaceLastLetter (c) +"ת" ) (italk + replaceLastLetter (c)+ "ים" ) (italk + replaceLastLetter (c) + "ות" )};
} -- FoodsHeb

View File

@@ -1,75 +0,0 @@
-- (c) 2010 Vikash Rauniyar under LGPL
concrete FoodsHin of Foods = {
flags coding=utf8 ;
param
Gender = Masc | Fem ;
Number = Sg | Pl ;
lincat
Comment = {s : Str} ;
Item = {s : Str ; g : Gender ; n : Number} ;
Kind = {s : Number => Str ; g : Gender} ;
Quality = {s : Gender => Number => Str} ;
lin
Pred item quality = {
s = item.s ++ quality.s ! item.g ! item.n ++ copula item.n
} ;
This kind = {s = "यह" ++ kind.s ! Sg ; g = kind.g ; n = Sg} ;
That kind = {s = "वह" ++ kind.s ! Sg ; g = kind.g ; n = Sg} ;
These kind = {s = "ये" ++ kind.s ! Pl ; g = kind.g ; n = Pl} ;
Those kind = {s = "वे" ++ kind.s ! Pl ; g = kind.g ; n = Pl} ;
Mod quality kind = {
s = \\n => quality.s ! kind.g ! n ++ kind.s ! n ;
g = kind.g
} ;
Wine = regN "मदिरा" ;
Cheese = regN "पनीर" ;
Fish = regN "मछली" ;
Pizza = regN "पिज़्ज़ा" ;
Very quality = {s = \\g,n => "अति" ++ quality.s ! g ! n} ;
Fresh = regAdj "ताज़ा" ;
Warm = regAdj "गरम" ;
Italian = regAdj "इटली" ;
Expensive = regAdj "बहुमूल्य" ;
Delicious = regAdj "स्वादिष्ट" ;
Boring = regAdj "अरुचिकर" ;
oper
mkN : Str -> Str -> Gender -> {s : Number => Str ; g : Gender} =
\s,p,g -> {
s = table {
Sg => s ;
Pl => p
} ;
g = g
} ;
regN : Str -> {s : Number => Str ; g : Gender} = \s -> case s of {
lark + "ा" => mkN s (lark + "े") Masc ;
lark + "ी" => mkN s (lark + "ीयँा") Fem ;
_ => mkN s s Masc
} ;
mkAdj : Str -> Str -> Str -> {s : Gender => Number => Str} = \ms,mp,f -> {
s = table {
Masc => table {
Sg => ms ;
Pl => mp
} ;
Fem => \\_ => f
}
} ;
regAdj : Str -> {s : Gender => Number => Str} = \a -> case a of {
acch + "ा" => mkAdj a (acch + "े") (acch + "ी") ;
_ => mkAdj a a a
} ;
copula : Number -> Str = \n -> case n of {
Sg => "है" ;
Pl => "हैं"
} ;
}

View File

@@ -1,29 +0,0 @@
-- (c) 2009 Aarne Ranta under LGPL
incomplete concrete FoodsI of Foods =
open Syntax, LexFoods in {
lincat
Comment = Utt ;
Item = NP ;
Kind = CN ;
Quality = AP ;
lin
Pred item quality = mkUtt (mkCl item quality) ;
This kind = mkNP this_Det kind ;
That kind = mkNP that_Det kind ;
These kind = mkNP these_Det kind ;
Those kind = mkNP those_Det kind ;
Mod quality kind = mkCN quality kind ;
Very quality = mkAP very_AdA quality ;
Wine = mkCN wine_N ;
Pizza = mkCN pizza_N ;
Cheese = mkCN cheese_N ;
Fish = mkCN fish_N ;
Fresh = mkAP fresh_A ;
Warm = mkAP warm_A ;
Italian = mkAP italian_A ;
Expensive = mkAP expensive_A ;
Delicious = mkAP delicious_A ;
Boring = mkAP boring_A ;
}

View File

@@ -1,84 +0,0 @@
--# -path=.:prelude
-- (c) 2009 Martha Dis Brandt under LGPL
concrete FoodsIce of Foods = open Prelude in {
--flags coding=utf8;
lincat
Comment = SS ;
Quality = {s : Gender => Number => Defin => Str} ;
Kind = {s : Number => Str ; g : Gender} ;
Item = {s : Str ; g : Gender ; n : Number} ;
lin
Pred item quality = ss (item.s ++ copula item.n ++ quality.s ! item.g ! item.n ! Ind) ;
This, That = det Sg "þessi" "þessi" "þetta" ;
These, Those = det Pl "þessir" "þessar" "þessi" ;
Mod quality kind = { s = \\n => quality.s ! kind.g ! n ! Def ++ kind.s ! n ; g = kind.g } ;
Wine = noun "vín" "vín" Neutr ;
Cheese = noun "ostur" "ostar" Masc ;
Fish = noun "fiskur" "fiskar" Masc ;
-- the word "pizza" is more commonly used in Iceland, but "flatbaka" is the Icelandic word for it
Pizza = noun "flatbaka" "flatbökur" Fem ;
Very qual = {s = \\g,n,defOrInd => "mjög" ++ qual.s ! g ! n ! defOrInd } ;
Fresh = regAdj "ferskur" ;
Warm = regAdj "heitur" ;
Boring = regAdj "leiðinlegur" ;
-- the order of the given adj forms is: mSg fSg nSg mPl fPl nPl mSgDef f/nSgDef _PlDef
Italian = adjective "ítalskur" "ítölsk" "ítalskt" "ítalskir" "ítalskar" "ítölsk" "ítalski" "ítalska" "ítalsku" ;
Expensive = adjective "dýr" "dýr" "dýrt" "dýrir" "dýrar" "dýr" "dýri" "dýra" "dýru" ;
Delicious = adjective "ljúffengur" "ljúffeng" "ljúffengt" "ljúffengir" "ljúffengar" "ljúffeng" "ljúffengi" "ljúffenga" "ljúffengu" ;
param
Number = Sg | Pl ;
Gender = Masc | Fem | Neutr ;
Defin = Ind | Def ;
oper
det : Number -> Str -> Str -> Str -> {s : Number => Str ; g : Gender} ->
{s : Str ; g : Gender ; n : Number} =
\n,masc,fem,neutr,cn -> {
s = case cn.g of {Masc => masc ; Fem => fem; Neutr => neutr } ++ cn.s ! n ;
g = cn.g ;
n = n
} ;
noun : Str -> Str -> Gender -> {s : Number => Str ; g : Gender} =
\man,men,g -> {
s = table {
Sg => man ;
Pl => men
} ;
g = g
} ;
adjective : (x1,_,_,_,_,_,_,_,x9 : Str) -> {s : Gender => Number => Defin => Str} =
\ferskur,fersk,ferskt,ferskir,ferskar,fersk_pl,ferski,ferska,fersku -> {
s = \\g,n,t => case <g,n,t> of {
< Masc, Sg, Ind > => ferskur ;
< Masc, Pl, Ind > => ferskir ;
< Fem, Sg, Ind > => fersk ;
< Fem, Pl, Ind > => ferskar ;
< Neutr, Sg, Ind > => ferskt ;
< Neutr, Pl, Ind > => fersk_pl;
< Masc, Sg, Def > => ferski ;
< Fem, Sg, Def > | < Neutr, Sg, Def > => ferska ;
< _ , Pl, Def > => fersku
}
} ;
regAdj : Str -> {s : Gender => Number => Defin => Str} = \ferskur ->
let fersk = Predef.tk 2 ferskur
in adjective
ferskur fersk (fersk + "t")
(fersk + "ir") (fersk + "ar") fersk
(fersk + "i") (fersk + "a") (fersk + "u") ;
copula : Number -> Str =
\n -> case n of {
Sg => "er" ;
Pl => "eru"
} ;
}

View File

@@ -1,8 +0,0 @@
--# -path=.:present
-- (c) 2009 Aarne Ranta under LGPL
concrete FoodsIta of Foods = FoodsI with
(Syntax = SyntaxIta),
(LexFoods = LexFoodsIta) ;

View File

@@ -1,72 +0,0 @@
--# -path=.:../lib/src/prelude
-- (c) 2009 Zofia Stankiewicz under LGPL
concrete FoodsJpn of Foods = open Prelude in {
flags coding=utf8 ;
lincat
Comment = {s: Style => Str};
Quality = {s: AdjUse => Str ; t: AdjType} ;
Kind = {s : Number => Str} ;
Item = {s : Str ; n : Number} ;
lin
Pred item quality = {s = case quality.t of {
IAdj => table {Plain => item.s ++ quality.s ! APred ; Polite => item.s ++ quality.s ! APred ++ copula ! Polite ! item.n } ;
NaAdj => \\p => item.s ++ quality.s ! APred ++ copula ! p ! item.n }
} ;
This = det Sg "この" ;
That = det Sg "その" ;
These = det Pl "この" ;
Those = det Pl "その" ;
Mod quality kind = {s = \\n => quality.s ! Attr ++ kind.s ! n} ;
Wine = regNoun "ワインは" ;
Cheese = regNoun "チーズは" ;
Fish = regNoun "魚は" ;
Pizza = regNoun "ピザは" ;
Very quality = {s = \\a => "とても" ++ quality.s ! a ; t = quality.t } ;
Fresh = adj "新鮮な" "新鮮";
Warm = regAdj "あたたかい" ;
Italian = adj "イタリアの" "イタリアのもの";
Expensive = regAdj "たかい" ;
Delicious = regAdj "おいしい" ;
Boring = regAdj "つまらない" ;
param
Number = Sg | Pl ;
AdjUse = Attr | APred ; -- na-adjectives have different forms as noun attributes and predicates
Style = Plain | Polite ; -- for phrase types
AdjType = IAdj | NaAdj ; -- IAdj can form predicates without the copula, NaAdj cannot
oper
det : Number -> Str -> {s : Number => Str} -> {s : Str ; n : Number} =
\n,d,cn -> {
s = d ++ cn.s ! n ;
n = n
} ;
noun : Str -> Str -> {s : Number => Str} =
\sakana,sakana -> {s = \\_ => sakana } ;
regNoun : Str -> {s : Number => Str} =
\sakana -> noun sakana sakana ;
adj : Str -> Str -> {s : AdjUse => Str ; t : AdjType} =
\chosenna, chosen -> {
s = table {
Attr => chosenna ;
APred => chosen
} ;
t = NaAdj
} ;
regAdj : Str -> {s: AdjUse => Str ; t : AdjType} =\akai -> {
s = \\_ => akai ; t = IAdj} ;
copula : Style => Number => Str =
table {
Plain => \\_ => "だ" ;
Polite => \\_ => "です" } ;
}

View File

@@ -1,91 +0,0 @@
--# -path=.:prelude
-- (c) 2009 Inese Bernsone under LGPL
concrete FoodsLav of Foods = open Prelude in {
flags
coding=utf8 ;
lincat
Comment = SS ;
Quality = {s : Q => Gender => Number => Defin => Str } ;
Kind = {s : Number => Str ; g : Gender} ;
Item = {s : Str ; g : Gender ; n : Number } ;
lin
Pred item quality = ss (item.s ++ {- copula item.n -} "ir" ++ quality.s ! Q1 ! item.g ! item.n ! Ind ) ;
This = det Sg "šis" "šī" ;
That = det Sg "tas" "tā" ;
These = det Pl "šie" "šīs" ;
Those = det Pl "tie" "tās" ;
Mod quality kind = {s = \\n => quality.s ! Q1 ! kind.g ! n ! Def ++ kind.s ! n ; g = kind.g } ;
Wine = noun "vīns" "vīni" Masc ;
Cheese = noun "siers" "sieri" Masc ;
Fish = noun "zivs" "zivis" Fem ;
Pizza = noun "pica" "picas" Fem ;
Very qual = {s = \\q,g,n,spec => "ļoti" ++ qual.s ! Q2 ! g ! n ! spec };
Fresh = adjective "svaigs" "svaiga" "svaigi" "svaigas" "svaigais" "svaigā" "svaigie" "svaigās" ;
Warm = regAdj "silts" ;
Italian = specAdj "itāļu" (regAdj "itālisks") ;
Expensive = regAdj "dārgs" ;
Delicious = regAdj "garšīgs" ;
Boring = regAdj "garlaicīgs" ;
param
Number = Sg | Pl ;
Gender = Masc | Fem ;
Defin = Ind | Def ;
Q = Q1 | Q2 ;
oper
det : Number -> Str -> Str -> {s : Number => Str ; g : Gender} ->
{s : Str ; g : Gender ; n : Number} =
\n,m,f,cn -> {
s = case cn.g of {Masc => m ; Fem => f} ++ cn.s ! n ;
g = cn.g ;
n = n
} ;
noun : Str -> Str -> Gender -> {s : Number => Str ; g : Gender} =
\man,men,g -> {
s = table {
Sg => man ;
Pl => men
} ;
g = g
} ;
adjective : (_,_,_,_,_,_,_,_ : Str) -> {s : Q => Gender => Number => Defin => Str} =
\skaists,skaista,skaisti,skaistas,skaistais,skaistaa,skaistie,skaistaas -> {
s = table {
_ => table {
Masc => table {
Sg => table {Ind => skaists ; Def => skaistais} ;
Pl => table {Ind => skaisti ; Def => skaistie}
} ;
Fem => table {
Sg => table {Ind => skaista ; Def => skaistaa} ;
Pl => table {Ind => skaistas ; Def => skaistaas}
}
}
}
} ;
{- irregAdj : Str -> {s : Gender => Number => Defin => Str} = \itaalju ->
let itaalju = itaalju
in adjective itaalju (itaalju) (itaalju) (itaalju) (itaalju) (itaalju) (itaalju) (itaalju) ; -}
regAdj : Str -> {s : Q => Gender => Number => Defin => Str} = \skaists ->
let skaist = init skaists
in adjective skaists (skaist + "a") (skaist + "i") (skaist + "as") (skaist + "ais") (skaist + "ā") (skaist + "ie") (skaist + "ās");
Adjective : Type = {s : Q => Gender => Number => Defin => Str} ;
specAdj : Str -> Adjective -> Adjective = \s,a -> {
s = table {
Q2 => a.s ! Q1 ;
Q1 => \\_,_,_ => s
}
} ;
}

View File

@@ -1,103 +0,0 @@
-- (c) 2009 John Camilleri under LGPL
concrete FoodsMlt of Foods = open Prelude in {
flags coding=utf8 ;
param
Number = Sg | Pl ;
Gender = Masc | Fem ;
lincat
Comment = SS ;
Quality = {s : Gender => Number => Str} ;
Kind = {s : Number => Str ; g : Gender} ;
Item = {s : Str ; g : Gender ; n : Number} ;
oper
--Create an adjective (full function)
--Params: Sing Masc, Sing Fem, Plural
adjective : (_,_,_ : Str) -> {s : Gender => Number => Str} = \iswed,sewda,suwed -> {
s = table {
Masc => table {
Sg => iswed ;
Pl => suwed
} ;
Fem => table {
Sg => sewda ;
Pl => suwed
}
}
} ;
--Create a regular adjective
--Param: Sing Masc
regAdj : Str -> {s : Gender => Number => Str} = \frisk ->
adjective frisk (frisk + "a") (frisk + "i") ;
--Create a "uni-adjective" eg tal-buzz
--Param: Sing Masc
uniAdj : Str -> {s : Gender => Number => Str} = \uni ->
adjective uni uni uni ;
--Create a noun
--Params: Singular, Plural, Gender (inherent)
noun : Str -> Str -> Gender -> {s : Number => Str ; g : Gender} = \ktieb,kotba,g -> {
s = table {
Sg => ktieb ;
Pl => kotba
} ;
g = g
} ;
--Copula is a linking verb
--Params: Number, Gender
copula : Number -> Gender -> Str = \n,g -> case n of {
Sg => case g of { Masc => "huwa" ; Fem => "hija" } ;
Pl => "huma"
} ;
--Create an article, taking into account first letter of next word
article = pre {
"a"|"e"|"i"|"o"|"u" => "l-" ;
--cons@("ċ"|"d"|"n"|"r"|"s"|"t"|"x"|"ż") => "i" + cons + "-" ;
_ => "il-"
} ;
--Create a determinant
--Params: Sg/Pl, Masc, Fem
det : Number -> Str -> Str -> Kind -> {s : Str ; g : Gender ; n : Number} = \n,m,f,cn -> {
s = case n of {
Sg => case cn.g of {Masc => m ; Fem => f}; --string
Pl => m --default to masc
} ++ article ++ cn.s ! n ;
g = cn.g ; --gender
n = n --number
} ;
lin
Pred item quality = ss (item.s ++ copula item.n item.g ++ quality.s ! item.g ! item.n) ;
This kind = det Sg "dan" "din" kind ;
That kind = det Sg "dak" "dik" kind ;
These kind = det Pl "dawn" "" kind ;
Those kind = det Pl "dawk" "" kind ;
Mod quality kind = {
s = \\n => kind.s ! n ++ quality.s ! kind.g ! n ;
g = kind.g
} ;
Wine = noun "inbid" "inbejjed" Masc ;
Cheese = noun "ġobon" "ġobniet" Masc ;
Fish = noun "ħuta" "ħut" Fem ;
Pizza = noun "pizza" "pizzez" Fem ;
Very qual = {s = \\g,n => qual.s ! g ! n ++ "ħafna"} ;
Warm = adjective "sħun" "sħuna" "sħan" ;
Expensive = adjective "għali" "għalja" "għaljin" ;
Delicious = adjective "tajjeb" "tajba" "tajbin" ;
Boring = uniAdj "tad-dwejjaq" ;
Fresh = regAdj "frisk" ;
Italian = regAdj "Taljan" ;
}

View File

@@ -1,49 +0,0 @@
--# -path=.:/GF/lib/src/prelude
-- (c) 2009 Nyamsuren Erdenebadrakh under LGPL
concrete FoodsMon of Foods = open Prelude in {
flags coding=utf8;
lincat
Comment, Quality = SS ;
Kind = {s : Number => Str} ;
Item = {s : Str ; n : Number} ;
lin
Pred item quality = ss (item.s ++ "бол" ++ quality.s) ;
This = det Sg "энэ" ;
That = det Sg "тэр" ;
These = det Pl "эдгээр" ;
Those = det Pl "тэдгээр" ;
Mod quality kind = {s = \\n => quality.s ++ kind.s ! n} ;
Wine = regNoun "дарс" ;
Cheese = regNoun "бяслаг" ;
Fish = regNoun "загас" ;
Pizza = regNoun "пицца" ;
Very = prefixSS "маш" ;
Fresh = ss "шинэ" ;
Warm = ss "халуун" ;
Italian = ss "итали" ;
Expensive = ss "үнэтэй" ;
Delicious = ss "амттай" ;
Boring = ss "амтгүй" ;
param
Number = Sg | Pl ;
oper
det : Number -> Str -> {s : Number => Str} -> {s : Str ; n : Number} =
\n,d,cn -> {
s = d ++ cn.s ! n ;
n = n
} ;
regNoun : Str -> {s : Number => Str} =
\x -> {s = table {
Sg => x ;
Pl => x + "нууд"}
} ;
}

View File

@@ -1,65 +0,0 @@
concrete FoodsPes of Foods = {
flags optimize=noexpand ; coding=utf8 ;
lincat
Comment = {s : Str} ;
Quality = {s : Add => Str; prep : Str} ;
Kind = {s : Add => Number => Str ; prep : Str};
Item = {s : Str ; n : Number};
lin
Pred item quality = {s = item.s ++ quality.s ! Indep ++ copula ! item.n} ;
This = det Sg "این" ;
That = det Sg "آن" ;
These = det Pl "این" ;
Those = det Pl "آن" ;
Mod quality kind = {s = \\a,n => kind.s ! Attr ! n ++ kind.prep ++ quality.s ! a ;
prep = quality.prep
};
Wine = regN "شراب" ;
Cheese = regN "پنیر" ;
Fish = regN "ماهى" ;
Pizza = regN "پیتزا" ;
Very a = {s = \\at => "خیلی" ++ a.s ! at ; prep = a.prep} ;
Fresh = adj "تازه" ;
Warm = adj "گرم" ;
Italian = adj "ایتالیایی" ;
Expensive = adj "گران" ;
Delicious = adj "لذىذ" ;
Boring = adj "ملال آور" ; -- it must be written as ملال آور.
param
Number = Sg | Pl ;
Add = Indep | Attr ;
oper
det : Number -> Str -> {s: Add => Number => Str ; prep : Str} -> {s : Str ; n: Number} =
\n,det,noun -> {s = det ++ noun.s ! Indep ! n ; n = n };
noun : (x1,_,_,x4 : Str) -> {s : Add => Number => Str ; prep : Str} = \pytzA, pytzAy, pytzAhA,pr ->
{s = \\a,n => case <a,n> of
{<Indep,Sg> => pytzA ; <Indep,Pl> => pytzAhA ;
<Attr,Sg> =>pytzA ; <Attr,Pl> => pytzAhA + "ى" };
prep = pr
};
regN : Str -> {s: Add => Number => Str ; prep : Str} = \mrd ->
case mrd of
{ _ + ("ا"|"ه"|"ى"|"و"|"") => noun mrd (mrd+"ى") (mrd + "ها") "";
_ => noun mrd mrd (mrd + "ها") "e"
};
adj : Str -> {s : Add => Str; prep : Str} = \tAzh ->
case tAzh of
{ _ + ("ا"|"ه"|"ى"|"و"|"") => mkAdj tAzh (tAzh ++ "ى") "" ;
_ => mkAdj tAzh tAzh "ه"
};
mkAdj : Str -> Str -> Str -> {s : Add => Str; prep : Str} = \tAzh, tAzhy, pr ->
{s = table {Indep => tAzh;
Attr => tAzhy};
prep = pr
};
copula : Number => Str = table {Sg => "است"; Pl => "هستند"};
}

View File

@@ -1,77 +0,0 @@
-- (c) 2009 Rami Shashati under LGPL
concrete FoodsPor of Foods = open Prelude in {
lincat
Comment = {s : Str} ;
Quality = {s : Gender => Number => Str} ;
Kind = {s : Number => Str ; g : Gender} ;
Item = {s : Str ; n : Number ; g : Gender } ;
lin
Pred item quality =
{s = item.s ++ copula ! item.n ++ quality.s ! item.g ! item.n } ;
This = det Sg (table {Masc => "este" ; Fem => "esta"}) ;
That = det Sg (table {Masc => "esse" ; Fem => "essa"}) ;
These = det Pl (table {Masc => "estes" ; Fem => "estas"}) ;
Those = det Pl (table {Masc => "esses" ; Fem => "essas"}) ;
Mod quality kind = { s = \\n => kind.s ! n ++ quality.s ! kind.g ! n ; g = kind.g } ;
Wine = regNoun "vinho" Masc ;
Cheese = regNoun "queijo" Masc ;
Fish = regNoun "peixe" Masc ;
Pizza = regNoun "pizza" Fem ;
Very a = { s = \\g,n => "muito" ++ a.s ! g ! n } ;
Fresh = mkAdjReg "fresco" ;
Warm = mkAdjReg "quente" ;
Italian = mkAdjReg "Italiano" ;
Expensive = mkAdjReg "caro" ;
Delicious = mkAdjReg "delicioso" ;
Boring = mkAdjReg "chato" ;
param
Number = Sg | Pl ;
Gender = Masc | Fem ;
oper
QualityT : Type = {s : Gender => Number => Str} ;
mkAdj : (_,_,_,_ : Str) -> QualityT = \bonito,bonita,bonitos,bonitas -> {
s = table {
Masc => table { Sg => bonito ; Pl => bonitos } ;
Fem => table { Sg => bonita ; Pl => bonitas }
} ;
} ;
-- regular pattern
adjSozinho : Str -> QualityT = \sozinho ->
let sozinh = Predef.tk 1 sozinho
in mkAdj sozinho (sozinh + "a") (sozinh + "os") (sozinh + "as") ;
-- for gender-independent adjectives
adjUtil : Str -> Str -> QualityT = \util,uteis ->
mkAdj util util uteis uteis ;
-- smart paradigm for adjcetives
mkAdjReg : Str -> QualityT = \a -> case last a of {
"o" => adjSozinho a ;
"e" => adjUtil a (a + "s")
} ;
ItemT : Type = {s : Str ; n : Number ; g : Gender } ;
det : Number -> (Gender => Str) -> KindT -> ItemT =
\num,det,noun -> {s = det ! noun.g ++ noun.s ! num ; n = num ; g = noun.g } ;
KindT : Type = {s : Number => Str ; g : Gender} ;
noun : Str -> Str -> Gender -> KindT =
\animal,animais,gen -> {s = table {Sg => animal ; Pl => animais} ; g = gen } ;
regNoun : Str -> Gender -> KindT =
\carro,gen -> noun carro (carro + "s") gen ;
copula : Number => Str = table {Sg => "é" ; Pl => "são"} ;
}

View File

@@ -1,72 +0,0 @@
-- (c) 2009 Ramona Enache under LGPL
concrete FoodsRon of Foods =
{
flags coding=utf8 ;
param Number = Sg | Pl ;
Gender = Masc | Fem ;
NGender = NMasc | NFem | NNeut ;
lincat
Comment = {s : Str};
Quality = {s : Number => Gender => Str};
Kind = {s : Number => Str; g : NGender};
Item = {s : Str ; n : Number; g : Gender};
lin
This = det Sg (mkTab "acest" "această");
That = det Sg (mkTab "acel" "acea");
These = det Pl (mkTab "acești" "aceste");
Those = det Pl (mkTab "acei" "acele");
Wine = mkNoun "vin" "vinuri" NNeut ;
Cheese = mkNoun "brânză" "brânzeturi" NFem ;
Fish = mkNoun "peşte" "peşti" NMasc ;
Pizza = mkNoun "pizza" "pizze" NFem;
Very a = {s = \\n,g => "foarte" ++ a.s ! n ! g};
Fresh = mkAdj "proaspăt" "proaspătă" "proaspeţi" "proaspete" ;
Warm = mkAdj "cald" "caldă" "calzi" "calde" ;
Italian = mkAdj "italian" "italiană" "italieni" "italiene" ;
Expensive = mkAdj "scump" "scumpă" "scumpi" "scumpe" ;
Delicious = mkAdj "delicios" "delcioasă" "delicioşi" "delicioase" ;
Boring = mkAdj "plictisitor" "plictisitoare" "plictisitori" "plictisitoare" ;
Pred item quality = {s = item.s ++ copula ! item.n ++ quality.s ! item.n ! item.g} ;
Mod quality kind = {s = \\n => kind.s ! n ++ quality.s ! n ! (getAgrGender kind.g n) ; g = kind.g};
oper
mkTab : Str -> Str -> {s : Gender => Str} = \acesta, aceasta ->
{s = table{Masc => acesta;
Fem => aceasta}};
det : Number -> {s : Gender => Str} -> {s : Number => Str ; g : NGender} -> {s : Str; n : Number; g : Gender} =
\n,det,noun -> let gg = getAgrGender noun.g n
in
{s = det.s ! gg ++ noun.s ! n ; n = n ; g = gg};
mkNoun : Str -> Str -> NGender -> {s : Number => Str; g : NGender} = \peste, pesti,g ->
{s = table {Sg => peste;
Pl => pesti};
g = g
};
oper mkAdj : (x1,_,_,x4 : Str) -> {s : Number => Gender => Str} = \scump, scumpa, scumpi, scumpe ->
{s = \\n,g => case <n,g> of
{<Sg,Masc> => scump ; <Sg,Fem> => scumpa;
<Pl,Masc> => scumpi ; <Pl,Fem> => scumpe
}};
copula : Number => Str = table {Sg => "este" ; Pl => "sunt"};
getAgrGender : NGender -> Number -> Gender = \ng,n ->
case <ng,n> of
{<NMasc,_> => Masc ; <NFem,_> => Fem;
<NNeut,Sg> => Masc ; <NNeut,Pl> => Fem
};
}

View File

@@ -1,7 +0,0 @@
--# -path=.:present
-- (c) 2009 Aarne Ranta under LGPL
concrete FoodsSwe of Foods = FoodsI with
(Syntax = SyntaxSwe),
(LexFoods = LexFoodsSwe) ** {flags language = sv_SE;} ;

View File

@@ -1,178 +0,0 @@
--# -path=alltenses
-- (c) 2009 Laurette Pretorius Sr & Jr and Ansu Berg under LGPL
concrete FoodsTsn of Foods = open Prelude, Predef in {
flags coding = utf8;
lincat
Comment = {s:Str};
Item = {s:Str; c:NounClass; n:Number};
Kind = {w: Number => Str; r: Str; c: NounClass; q: Number => Str; b: Bool};
Quality = {s: NounClass => Number => Str; p_form: Str; t: TType};
lin
Pred item quality = {s = item.s ++ ((mkPredDescrCop quality.t) ! item.c ! item.n) ++ quality.p_form};
This kind = {s = (kind.w ! Sg) ++ (mkDemPron1 ! kind.c ! Sg) ++ (kind.q ! Sg); c = kind.c; n = Sg};
That kind = {s = (kind.w ! Sg) ++ (mkDemPron2 ! kind.c ! Sg) ++ (kind.q ! Sg); c = kind.c; n = Sg};
These kind = {s = (kind.w ! Pl) ++ (mkDemPron1 ! kind.c ! Pl) ++ (kind.q ! Pl); c = kind.c; n = Pl};
Those kind = {s = (kind.w ! Pl) ++ (mkDemPron2 ! kind.c ! Pl) ++ (kind.q ! Pl); c = kind.c; n = Pl};
Mod quality kind = mkMod quality kind;
-- Lexicon
Wine = mkNounNC14_6 "jalwa";
Cheese = mkNounNC9_10 "kase";
Fish = mkNounNC9_10 "thlapi";
Pizza = mkNounNC9_10 "pizza";
Very quality = smartVery quality;
Fresh = mkVarAdj "ntsha";
Warm = mkOrdAdj "bothitho";
Italian = mkPerAdj "Itali";
Expensive = mkVerbRel "tura";
Delicious = mkOrdAdj "monate";
Boring = mkOrdAdj "bosula";
param
NounClass = NC9_10 | NC14_6;
Number = Sg | Pl;
TType = P | V | ModV | R ;
oper
mkMod : {s: NounClass => Number => Str; p_form: Str; t: TType} -> {w: Number => Str; r: Str; c: NounClass; q: Number => Str; b: Bool} -> {w: Number => Str; r: Str; c: NounClass; q: Number => Str;
b: Bool} = \x,y -> case y.b of
{
True => {w = y.w; r = y.r; c = y.c;
q = table {
Sg => ((y.q ! Sg) ++ "le" ++ ((smartQualRelPart (x.t)) ! y.c ! Sg) ++ ((smartDescrCop (x.t)) ! y.c ! Sg) ++ (x.s ! y.c ! Sg));
Pl => ((y.q ! Pl) ++ "le" ++ ((smartQualRelPart (x.t))! y.c ! Pl) ++ ((smartDescrCop (x.t)) ! y.c ! Pl) ++(x.s ! y.c ! Pl))
}; b = True
};
False => {w = y.w; r = y.r; c = y.c;
q = table {
Sg => ((y.q ! Sg) ++ ((smartQualRelPart (x.t)) ! y.c ! Sg) ++ ((smartDescrCop (x.t)) ! y.c ! Sg) ++ (x.s ! y.c ! Sg));
Pl => ((y.q ! Pl) ++ ((smartQualRelPart (x.t)) ! y.c ! Pl) ++ ((smartDescrCop (x.t)) ! y.c ! Pl) ++(x.s ! y.c ! Pl))
}; b = True
}
};
mkNounNC14_6 : Str -> {w: Number => Str; r: Str; c: NounClass; q: Number => Str; b: Bool} = \x -> {w = table {Sg => "bo" + x; Pl => "ma" + x}; r = x; c = NC14_6;
q = table {Sg => ""; Pl => ""}; b = False};
mkNounNC9_10 : Str -> {w: Number => Str; r: Str; c: NounClass; q: Number => Str; b: Bool} = \x -> {w = table {Sg => "" + x; Pl => "di" + x}; r = x; c = NC9_10;
q = table {Sg => ""; Pl => ""}; b = False};
mkVarAdj : Str -> {s: NounClass => Number => Str; p_form: Str; t: TType} = \x ->
{
s = table {
NC9_10 => table {Sg => "" + x; Pl => "di" + x};
NC14_6 => table {Sg => "bo" + x; Pl => "ma" + x}
};
p_form = x;
t = R;
};
mkOrdAdj : Str -> {s: NounClass => Number => Str; p_form: Str; t: TType} = \x ->
{
s = table {
NC9_10 => table {Sg => "" + x; Pl => "" + x};
NC14_6 => table {Sg => "" + x; Pl => "" + x}
};
p_form = x;
t = R;
};
mkVerbRel : Str -> {s: NounClass => Number => Str; p_form: Str; t: TType} = \x ->
{
s = table {
NC9_10 => table {Sg => x + "ng"; Pl => x + "ng"};
NC14_6 => table {Sg => x + "ng"; Pl => x + "ng"}
};
p_form = x;
t = V;
};
mkPerAdj : Str -> {s: NounClass => Number => Str; p_form: Str; t: TType} = \x ->
{
s = table {
NC9_10 => table {Sg => "" + x; Pl => "" + x};
NC14_6 => table {Sg => "" + x; Pl => "" + x}
};
p_form = "mo" ++ x;
t = P;
};
mkVeryAdj : {s: NounClass => Number => Str; p_form: Str; t: TType} -> {s: NounClass => Number => Str; p_form: Str; t: TType} = \x ->
{
s = table{c => table{n => (x.s!c!n) ++ "thata"}}; p_form = x.p_form ++ "thata"; t = x.t
};
mkVeryVerb : {s: NounClass => Number => Str; p_form: Str; t: TType} -> {s: NounClass => Number => Str; p_form: Str; t: TType} = \x ->
{
s = table{c => table{n => (x.s!c!n) ++ "thata"}}; p_form = x.p_form ++ "thata"; t = ModV
};
smartVery : {s: NounClass => Number => Str; p_form: Str; t: TType} -> {s: NounClass => Number => Str; p_form: Str; t: TType} =
\x -> case x.t of --(x.s!c!n)
{
(V | ModV) => mkVeryVerb x;
--ModV => mkVeryVerb x;
_ => mkVeryAdj x
};
mkDemPron1 : NounClass => Number => Str = table
{
NC9_10 => table {Sg => "e"; Pl => "tse"};
NC14_6 => table {Sg => "bo"; Pl => "a"}
};
mkDemPron2 : NounClass => Number => Str = table
{
NC9_10 => table {Sg => "eo"; Pl => "tseo"};
NC14_6 => table {Sg => "boo"; Pl => "ao"}
};
smartQualRelPart : TType -> (NounClass => Number => Str) = \x -> case x of
{
P => mkQualRelPart_PName;
_ => mkQualRelPart
};
mkQualRelPart : NounClass => Number => Str = table
{
NC9_10 => table {Sg => "e"; Pl => "tse"};
NC14_6 => table {Sg => "bo"; Pl => "a"}
};
mkQualRelPart_PName : NounClass => Number => Str = table
{
NC9_10 => table {Sg => "ya"; Pl => "tsa"};
NC14_6 => table {Sg => "ba"; Pl => "a"}
};
smartDescrCop : TType -> (NounClass => Number => Str) = \x -> case x of
{
P => mkDescrCop_PName;
_ => mkDescrCop
};
mkDescrCop : NounClass => Number => Str = table
{
NC9_10 => table {Sg => "e"; Pl => "di"};
NC14_6 => table {Sg => "bo"; Pl => "a"}
};
mkDescrCop_PName : NounClass => Number => Str = table
{
NC9_10 => table {Sg => "ga"; Pl => "ga"};
NC14_6 => table {Sg => "ga"; Pl => "ga"}
};
mkPredDescrCop : TType -> (NounClass => Number => Str) = \x -> case x of
{
V => table {NC9_10 => table {Sg => "e" ++ "a"; Pl => "di" ++ "a"};
NC14_6 => table {Sg => "bo" ++ "a"; Pl => "a" ++ "a"}};
_ => table {NC9_10 => table {Sg => "e"; Pl => "di"};
NC14_6 => table {Sg => "bo"; Pl => "a"}}
};
}

View File

@@ -1,140 +0,0 @@
{-
File : FoodsTur.gf
Author : Server Çimen
Version : 1.0
Created on: August 26, 2009
This file contains concrete grammar of Foods abstract grammar for Turkish Language.
This grammar is to be used for Fridge demo and developed in the scope of GF Resource
Grammar Summer School.
-}
concrete FoodsTur of Foods = open Predef in {
flags
coding=utf8 ;
lincat
Comment = {s : Str} ;
Quality = {s : Str ; c : Case; softness : Softness; h : Harmony} ;
Kind = {s : Case => Number => Str} ;
Item = {s : Str; n : Number} ;
lin
This = det Sg "bu" ;
That = det Sg "şu" ;
These = det Pl "bu" ;
Those = det Pl "şu" ;
-- Reason for excluding plural form of copula: In Turkish if subject is not a human being,
-- then singular form of copula is used regardless of the number of subject. Since all
-- possible subjects are non human, copula do not need to have plural form.
Pred item quality = {s = item.s ++ quality.s ++ "&+" ++ copula ! quality.softness ! quality.h} ;--! item.n} ;
Mod quality kind = {s = case quality.c of {
Nom => \\t,n => quality.s ++ kind.s ! t ! n ;
Gen => \\t,n => quality.s ++ kind.s ! Gen ! n
}
} ;
Wine = mkN "şarap" "şaraplar" "şarabı" "şarapları" ;
Cheese = mkN "peynir" "peynirler" "peyniri" "peynirleri" ;
Fish = mkN "balık" "balıklar" "balığı" "balıkları" ;
Pizza = mkN "pizza" "pizzalar" "pizzası" "pizzaları" ;
Very a = {s = "çok" ++ a.s ; c = a.c; softness = a.softness; h = a.h} ;
Fresh = adj "taze" Nom;
Warm = adj "ılık" Nom;
Italian = adj "İtalyan" Gen ;
Expensive = adj "pahalı" Nom;
Delicious = adj "lezzetli" Nom;
Boring = adj "sıkıcı" Nom;
param
Number = Sg | Pl ;
Case = Nom | Gen ;
Harmony = I_Har | Ih_Har | U_Har | Uh_Har ; --Ih = İ; Uh = Ü
Softness = Soft | Hard ;
oper
det : Number -> Str -> {s : Case => Number => Str} -> {s : Str; n : Number} =
\num,det,noun -> {s = det ++ noun.s ! Nom ! num; n = num} ;
mkN = overload {
mkN : Str -> Str -> {s : Case => Number => Str} = regNoun ;
mkn : Str -> Str -> Str -> Str-> {s : Case => Number => Str} = noun ;
} ;
regNoun : Str -> Str -> {s : Case => Number => Str} =
\peynir,peynirler -> noun peynir peynirler [] [] ;
noun : Str -> Str -> Str -> Str-> {s : Case => Number => Str} =
\sarap,saraplar,sarabi,saraplari -> {
s = table {
Nom => table {
Sg => sarap ;
Pl => saraplar
} ;
Gen => table {
Sg => sarabi ;
Pl => saraplari
}
}
};
{-
Since there is a bug in overloading, this overload is useless.
mkA = overload {
mkA : Str -> {s : Str; c : Case; softness : Softness; h : Harmony} = \base -> adj base Nom ;
mkA : Str -> Case -> {s : Str; c : Case; softness : Softness; h : Harmony} = adj ;
} ;
-}
adj : Str -> Case -> {s : Str; c : Case; softness : Softness; h : Harmony} =
\italyan,ca -> {s = italyan ; c = ca; softness = (getSoftness italyan); h = (getHarmony italyan)} ;
-- See the comment at lines 26 and 27 for excluded plural form of copula.
copula : Softness => Harmony {-=> Number-} => Str =
table {
Soft => table {
I_Har => "dır" ;--table {
-- Sg => "dır" ;
-- Pl => "dırlar"
--} ;
Ih_Har => "dir" ;--table {
--Sg => "dir" ;
--Pl => "dirler"
--} ;
U_Har => "dur" ;--table {
-- Sg => "dur" ;
-- Pl => "durlar"
--} ;
Uh_Har => "dür" --table {
--Sg => "dür" ;
--Pl => "dürler"
--}
} ;
Hard => table {
I_Har => "tır" ;--table {
--Sg => "tır" ;
--Pl => "tırlar"
--} ;
Ih_Har => "tir" ;--table {
--Sg => "tir" ;
--Pl => "tirler"
--} ;
U_Har => "tur" ;--table {
-- Sg => "tur" ;
-- Pl => "turlar"
--} ;
Uh_Har => "tür"--table {
--Sg => "tür" ;
--Pl => "türler"
--}
}
} ;
getHarmony : Str -> Harmony
= \base -> case base of {
_+c@("ı"|"a"|"i"|"e"|"u"|"o"|"ü"|"ö")+
("b"|"v"|"d"|"z"|"j"|"c"|"g"|"ğ"|"l"|"r"|"m"|"n"|"y"|"p"|"f"|"t"|"s"|"ş"|"ç"|"k"|"h")* =>
case c of {
("ı"|"a") => I_Har ;
("i"|"e") => Ih_Har ;
("u"|"o") => U_Har ;
("ü"|"ö") => Uh_Har
}
} ;
getSoftness : Str -> Softness
= \base -> case base of {
_+("f"|"s"|"t"|"k"|"ç"|"ş"|"h"|"p") => Hard ;
_ => Soft
} ;
}

View File

@@ -1,53 +0,0 @@
-- (c) 2009 Shafqat Virk under LGPL
concrete FoodsUrd of Foods = {
flags coding=utf8 ;
param Number = Sg | Pl ;
param Gender = Masc | Fem;
oper coupla : Number -> Str =\n -> case n of {Sg => "ہے" ; Pl => "ہیں"};
lincat
Comment = {s : Str} ;
Item = {s: Str ; n: Number ; g:Gender};
Kind = {s: Number => Str ; g:Gender};
Quality = {s: Gender => Number => Str};
lin
Pred item quality = {s = item.s ++ quality.s ! item.g ! item.n ++ coupla item.n} ;
This kind = {s = "یھ" ++ kind.s ! Sg; n= Sg ; g = kind.g } ;
These kind = {s = "یھ" ++ kind.s ! Pl; n = Pl ; g = kind.g} ;
That kind = {s = "وہ" ++ kind.s ! Sg; n= Sg ; g = kind.g} ;
Those kind = {s = "وہ" ++ kind.s ! Pl; n=Pl ; g = kind.g} ;
Mod quality kind = {s = \\n => quality.s ! kind.g ! n ++ kind.s ! n ; g = kind.g};
Wine = {s = table { Sg => "شراب" ; Pl => "شرابیں"} ; g = Fem};
Cheese = {s = table { Sg => "پنیر" ; Pl => "پنیریں"} ; g = Fem};
Fish = {s = table { Sg => "مچھلی" ; Pl => "مچھلیاں"} ; g = Fem};
Pizza = {s = table { Sg => "پیزہ" ; Pl => "پیزے"} ; g = Masc};
Very quality = {s = \\g,n => "بہت" ++ quality.s ! g ! n} ;
Fresh = regAdj "تازہ" ;
Warm = regAdj "گرم" ;
Italian = regAdj "اٹا لوی" ;
Expensive = regAdj "مہنگا" ;
Delicious = regAdj "مزیدار" ;
Boring = regAdj "فضول" ;
oper
regAdj : Str -> {s: Gender => Number => Str} = \a -> case a of {
x + "ا" => mkAdj a (x+"ے") (x+"ی");
_ => mkAdj a a a
};
mkAdj : Str -> Str -> Str -> {s: Gender => Number => Str} = \s,p,f -> {
s = table {
Masc => table {
Sg => s;
Pl => p
};
Fem => \\_ => f
}
};
}

View File

@@ -1,15 +0,0 @@
-- (c) 2009 Aarne Ranta under LGPL
interface LexFoods = open Syntax in {
oper
wine_N : N ;
pizza_N : N ;
cheese_N : N ;
fish_N : N ;
fresh_A : A ;
warm_A : A ;
italian_A : A ;
expensive_A : A ;
delicious_A : A ;
boring_A : A ;
}

View File

@@ -1,18 +0,0 @@
-- (c) 2009 Jordi Saludes under LGPL
instance LexFoodsCat of LexFoods =
open SyntaxCat, ParadigmsCat, (M = MorphoCat) in {
flags
coding = utf8 ;
oper
wine_N = mkN "vi" "vins" M.Masc ;
pizza_N = mkN "pizza" ;
cheese_N = mkN "formatge" ;
fish_N = mkN "peix" "peixos" M.Masc;
fresh_A = mkA "fresc" "fresca" "frescos" "fresques" "frescament";
warm_A = mkA "calent" ;
italian_A = mkA "italià" "italiana" "italians" "italianes" "italianament" ;
expensive_A = mkA "car" ;
delicious_A = mkA "deliciós" "deliciosa" "deliciosos" "delicioses" "deliciosament";
boring_A = mkA "aburrit" "aburrida" "aburrits" "aburrides" "aburridament" ;
}

View File

@@ -1,20 +0,0 @@
-- (c) 2009 Aarne Ranta under LGPL
instance LexFoodsFin of LexFoods =
open SyntaxFin, ParadigmsFin in {
oper
wine_N = mkN "viini" ;
pizza_N = mkN "pizza" ;
cheese_N = mkN "juusto" ;
fish_N = mkN "kala" ;
fresh_A = mkA "tuore" ;
warm_A = mkA
(mkN "lämmin" "lämpimän" "lämmintä" "lämpimänä" "lämpimään"
"lämpiminä" "lämpimiä" "lämpimien" "lämpimissä" "lämpimiin"
)
"lämpimämpi" "lämpimin" ;
italian_A = mkA "italialainen" ;
expensive_A = mkA "kallis" ;
delicious_A = mkA "herkullinen" ;
boring_A = mkA "tylsä" ;
}

View File

@@ -1,16 +0,0 @@
-- (c) 2009 Aarne Ranta under LGPL
instance LexFoodsGer of LexFoods =
open SyntaxGer, ParadigmsGer in {
oper
wine_N = mkN "Wein" ;
pizza_N = mkN "Pizza" "Pizzen" feminine ;
cheese_N = mkN "Käse" "Käse" masculine ;
fish_N = mkN "Fisch" ;
fresh_A = mkA "frisch" ;
warm_A = mkA "warm" "wärmer" "wärmste" ;
italian_A = mkA "italienisch" ;
expensive_A = mkA "teuer" ;
delicious_A = mkA "köstlich" ;
boring_A = mkA "langweilig" ;
}

View File

@@ -1,16 +0,0 @@
-- (c) 2009 Aarne Ranta under LGPL
instance LexFoodsIta of LexFoods =
open SyntaxIta, ParadigmsIta in {
oper
wine_N = mkN "vino" ;
pizza_N = mkN "pizza" ;
cheese_N = mkN "formaggio" ;
fish_N = mkN "pesce" ;
fresh_A = mkA "fresco" ;
warm_A = mkA "caldo" ;
italian_A = mkA "italiano" ;
expensive_A = mkA "caro" ;
delicious_A = mkA "delizioso" ;
boring_A = mkA "noioso" ;
}

View File

@@ -1,16 +0,0 @@
-- (c) 2009 Aarne Ranta under LGPL
instance LexFoodsSwe of LexFoods =
open SyntaxSwe, ParadigmsSwe in {
oper
wine_N = mkN "vin" "vinet" "viner" "vinerna" ;
pizza_N = mkN "pizza" ;
cheese_N = mkN "ost" ;
fish_N = mkN "fisk" ;
fresh_A = mkA "färsk" ;
warm_A = mkA "varm" ;
italian_A = mkA "italiensk" ;
expensive_A = mkA "dyr" ;
delicious_A = mkA "läcker" ;
boring_A = mkA "tråkig" ;
}

View File

@@ -1,8 +0,0 @@
all:: Foods.pgf
Foods.pgf: Foods???.gf
gf -make -s -optimize-pgf Foods???.gf
clean:
rm -rf *.gfo Foods.pgf

View File

@@ -1,8 +0,0 @@
Foods grammars from GF Summer School 2009. To build:
$ gf -make -s Foods???.gf -- to create Foods.pgf
$ mv Foods.pgf ~/GF/src/server/gwt/www/grammars/ -- to use in web applications

View File

@@ -1,75 +0,0 @@
-- (c) 2009 Aarne Ranta under LGPL
concrete FoodsHin of Foods = {
flags coding=utf8 ;
param
Gender = Masc | Fem ;
Number = Sg | Pl ;
lincat
Comment = {s : Str} ;
Item = {s : Str ; g : Gender ; n : Number} ;
Kind = {s : Number => Str ; g : Gender} ;
Quality = {s : Gender => Number => Str} ;
lin
Pred item quality = {
s = item.s ++ quality.s ! item.g ! item.n ++ copula item.n
} ;
This kind = {s = "yah" ++ kind.s ! Sg ; g = kind.g ; n = Sg} ;
That kind = {s = "vah" ++ kind.s ! Sg ; g = kind.g ; n = Sg} ;
These kind = {s = "ye" ++ kind.s ! Pl ; g = kind.g ; n = Pl} ;
Those kind = {s = "ve" ++ kind.s ! Pl ; g = kind.g ; n = Pl} ;
Mod quality kind = {
s = \\n => quality.s ! kind.g ! n ++ kind.s ! n ;
g = kind.g
} ;
Wine = regN "madirA" ;
Cheese = regN "panIr" ;
Fish = regN "maClI" ;
Pizza = regN "pijjA" ;
Very quality = {s = \\g,n => "bahut" ++ quality.s ! g ! n} ;
Fresh = regAdj "tAzA" ;
Warm = regAdj "garam" ;
Italian = regAdj "i-t.alI" ;
Expensive = regAdj "mahaNgA" ;
Delicious = regAdj "rucikar" ;
Boring = regAdj "pEriyA" ;
oper
mkN : Str -> Str -> Gender -> {s : Number => Str ; g : Gender} =
\s,p,g -> {
s = table {
Sg => s ;
Pl => p
} ;
g = g
} ;
regN : Str -> {s : Number => Str ; g : Gender} = \s -> case s of {
lark + "A" => mkN s (lark + "e") Masc ;
lark + "I" => mkN s (lark + "iyaM") Fem ;
_ => mkN s s Masc
} ;
mkAdj : Str -> Str -> Str -> {s : Gender => Number => Str} = \ms,mp,f -> {
s = table {
Masc => table {
Sg => ms ;
Pl => mp
} ;
Fem => \\_ => f
}
} ;
regAdj : Str -> {s : Gender => Number => Str} = \a -> case a of {
acch + "A" => mkAdj a (acch + "e") (acch + "I") ;
_ => mkAdj a a a
} ;
copula : Number -> Str = \n -> case n of {
Sg => "hE" ;
Pl => "hEN"
} ;
}

View File

@@ -1,36 +0,0 @@
abstract Grammar = {
flags startcat = S ;
cat
S ; Cl ; NP ; VP ; AP ; CN ;
Det ; N ; A ; V ; V2 ; AdA ;
Tense ; Pol ;
Conj ;
fun
UseCl : Tense -> Pol -> Cl -> S ;
PredVP : NP -> VP -> Cl ;
ComplV2 : V2 -> NP -> VP ;
DetCN : Det -> CN -> NP ;
ModCN : AP -> CN -> CN ;
CompAP : AP -> VP ;
AdAP : AdA -> AP -> AP ;
ConjNP : Conj -> NP -> NP -> NP ;
UseV : V -> VP ;
UseN : N -> CN ;
UseA : A -> AP ;
a_Det, the_Det : Det ;
this_Det, these_Det : Det ;
that_Det, those_Det : Det ;
i_NP, she_NP, we_NP : NP ;
very_AdA : AdA ;
Pos, Neg : Pol ;
Pres, Perf : Tense ;
and_Conj, or_Conj : Conj ;
}

View File

@@ -1,137 +0,0 @@
concrete GrammarIta of Grammar = open ResIta, Prelude in {
lincat
S = {s : Str} ;
Cl = {s : ResIta.Tense => Bool => Str} ;
NP = ResIta.NP ;
-- {s : Case => {clit,obj : Str ; isClit : Bool} ; a : Agr} ;
VP = ResIta.VP ;
-- {v : Verb ; clit : Str ; clitAgr : ClitAgr ; obj : Agr => Str} ;
AP = {s : Gender => Number => Str ; isPre : Bool} ;
CN = Noun ; -- {s : Number => Str ; g : Gender} ;
Det = {s : Gender => Case => Str ; n : Number} ;
N = Noun ; -- {s : Number => Str ; g : Gender} ;
A = Adj ; -- {s : Gender => Number => Str ; isPre : Bool} ;
V = Verb ; -- {s : VForm => Str ; aux : Aux} ;
V2 = Verb ** {c : Case} ;
AdA = {s : Str} ;
Pol = {s : Str ; b : Bool} ;
Tense = {s : Str ; t : ResIta.Tense} ;
Conj = {s : Str ; n : Number} ;
lin
UseCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! p.b} ;
PredVP np vp =
let
subj = (np.s ! Nom).obj ;
obj = vp.obj ! np.a ;
clit = vp.clit ;
verb = table {
Pres => agrV vp.v np.a ;
Perf => agrV (auxVerb vp.v.aux) np.a ++ agrPart vp.v np.a vp.clitAgr
}
in {
s = \\t,b => subj ++ neg b ++ clit ++ verb ! t ++ obj
} ;
ComplV2 v2 np =
let
nps = np.s ! v2.c
in {
v = {s = v2.s ; aux = v2.aux} ;
clit = nps.clit ;
clitAgr = case <nps.isClit,v2.c> of {
<True,Acc> => CAgr np.a ;
_ => CAgrNo
} ;
obj = \\_ => nps.obj
} ;
UseV v = {
v = v ;
clit = [] ;
clitAgr = CAgrNo ;
obj = \\_ => []
} ;
DetCN det cn = {
s = \\c => {
obj = det.s ! cn.g ! c ++ cn.s ! det.n ;
clit = [] ;
isClit = False
} ;
a = Ag cn.g det.n Per3
} ;
ModCN ap cn = {
s = \\n => preOrPost ap.isPre (ap.s ! cn.g ! n) (cn.s ! n) ;
g = cn.g
} ;
CompAP ap = {
v = essere_V ;
clit = [] ;
clitAgr = CAgrNo ;
obj = \\ag => case ag of {
Ag g n _ => ap.s ! g ! n
}
} ;
AdAP ada ap = {
s = \\g,n => ada.s ++ ap.s ! g ! n ;
isPre = ap.isPre ;
} ;
ConjNP co nx ny = {
s = \\c => {
obj = (nx.s ! c).obj ++ co.s ++ (ny.s ! c).obj ;
clit = [] ;
isClit = False
} ;
a = ny.a ; ---- should be conjAgr co.n nx.a ny.a
} ;
UseN n = n ;
UseA adj = adj ;
a_Det = adjDet (mkAdj "un" "una" [] [] True) Sg ;
the_Det = {
s = table {
Masc => table {
Nom | Acc => elisForms "lo" "l'" "il" ;
Dat => elisForms "allo" "all'" "al"
} ;
Fem => table {
Nom | Acc => elisForms "la" "'l" "la" ;
Dat => elisForms "alla" "all'" "alla"
}
} ;
n = Sg
} ;
this_Det = adjDet (regAdj "questo") Sg ;
these_Det = adjDet (regAdj "questo") Pl ;
that_Det = adjDet quello_A Sg ;
those_Det = adjDet quello_A Pl ;
i_NP = pronNP "io" "mi" "mi" Masc Sg Per1 ;
she_NP = pronNP "lei" "la" "le" Fem Sg Per3 ;
we_NP = pronNP "noi" "ci" "ci" Masc Pl Per1 ;
very_AdA = ss "molto" ;
Pos = {s = [] ; b = True} ;
Neg = {s = [] ; b = False} ;
Pres = {s = [] ; t = ResIta.Pres} ;
Perf = {s = [] ; t = ResIta.Perf} ;
and_Conj = {s = "e" ; n = Pl} ;
or_Conj = {s = "o" ; n = Sg} ;
oper
quello_A : Adj = mkAdj
(elisForms "quello" "quell'" "quel") "quella"
(elisForms "quegli" "quegli" "quei") "quelle"
True ;
}

View File

@@ -1,47 +0,0 @@
resource ParadigmsIta = GrammarIta [N,A,V] **
open ResIta, GrammarIta, Prelude in {
oper
masculine : Gender = Masc ;
feminine : Gender = Fem ;
accusative : Case = Acc ;
dative : Case = Dat ;
mkN = overload {
mkN : (vino : Str) -> N
= \n -> lin N (regNoun n) ;
mkN : (uomo, uomini : Str) -> Gender -> N
= \s,p,g -> lin N (mkNoun s p g) ;
} ;
mkA = overload {
mkA : (nero : Str) -> A
= \a -> lin A (regAdj a) ;
mkA : (buono,buona,buoni,buone : Str) -> Bool -> A
= \sm,sf,pm,pf,p -> lin A (mkAdj sm sf pm pf False) ;
} ;
preA : A -> A
= \a -> lin A {s = a.s ; isPre = True} ;
mkV = overload {
mkV : (finire : Str) -> V
= \v -> lin V (regVerb v) ;
mkV : (andare,vado,vadi,va,andiamo,andate,vanno,andato : Str) -> V
= \i,p1,p2,p3,p4,p5,p6,p -> lin V (mkVerb i p1 p2 p3 p4 p5 p6 p Avere) ;
} ;
essereV : V -> V
= \v -> lin V {s = v.s ; aux = Essere} ;
mkV2 = overload {
mkV2 : Str -> V2
= \s -> lin V2 (regVerb s ** {c = accusative}) ;
mkV2 : V -> V2
= \v -> lin V2 (v ** {c = accusative}) ;
mkV2 : V -> Case -> V2
= \v,c -> lin V2 (v ** {c = c}) ;
} ;
}

View File

@@ -1,178 +0,0 @@
resource ResIta = open Prelude in {
-- parameters
param
Number = Sg | Pl ;
Gender = Masc | Fem ;
Case = Nom | Acc | Dat ;
Agr = Ag Gender Number Person ;
Aux = Avere | Essere ;
Tense = Pres | Perf ;
Person = Per1 | Per2 | Per3 ;
VForm = VInf | VPres Number Person | VPart Gender Number ;
ClitAgr = CAgrNo | CAgr Agr ;
-- parts of speech
oper
VP = {
v : Verb ;
clit : Str ;
clitAgr : ClitAgr ;
obj : Agr => Str
} ;
NP = {
s : Case => {clit,obj : Str ; isClit : Bool} ;
a : Agr
} ;
-- the preposition word of an abstract case
prepCase : Case -> Str = \c -> case c of {
Dat => "a" ;
_ => []
} ;
-- for predication
agrV : Verb -> Agr -> Str = \v,a -> case a of {
Ag _ n p => v.s ! VPres n p
} ;
auxVerb : Aux -> Verb = \a -> case a of {
Avere =>
mkVerb "avere" "ho" "hai" "ha" "abbiamo" "avete" "hanno" "avuto" Avere ;
Essere =>
mkVerb "essere" "sono" "sei" "è" "siamo" "siete" "sono" "stato" Essere
} ;
agrPart : Verb -> Agr -> ClitAgr -> Str = \v,a,c -> case v.aux of {
Avere => case c of {
CAgr (Ag g n _) => v.s ! VPart g n ;
_ => v.s ! VPart Masc Sg
} ;
Essere => case a of {
Ag g n _ => v.s ! VPart g n
}
} ;
neg : Bool -> Str = \b -> case b of {True => [] ; False => "non"} ;
essere_V = auxVerb Essere ;
-- for coordination
conjAgr : Number -> Agr -> Agr -> Agr = \n,xa,ya ->
let
x = agrFeatures xa ; y = agrFeatures ya
in Ag
(conjGender x.g y.g)
(conjNumber (conjNumber x.n y.n) n)
(conjPerson x.p y.p) ;
agrFeatures : Agr -> {g : Gender ; n : Number ; p : Person} = \a ->
case a of {Ag g n p => {g = g ; n = n ; p = p}} ;
conjGender : Gender -> Gender -> Gender = \g,h ->
case g of {Masc => Masc ; _ => h} ;
conjNumber : Number -> Number -> Number = \m,n ->
case m of {Pl => Pl ; _ => n} ;
conjPerson : Person -> Person -> Person = \p,q ->
case <p,q> of {
<Per1,_> | <_,Per1> => Per1 ;
<Per2,_> | <_,Per2> => Per2 ;
_ => Per3
} ;
-- for morphology
Noun : Type = {s : Number => Str ; g : Gender} ;
Adj : Type = {s : Gender => Number => Str ; isPre : Bool} ;
Verb : Type = {s : VForm => Str ; aux : Aux} ;
mkNoun : Str -> Str -> Gender -> Noun = \vino,vini,g -> {
s = table {Sg => vino ; Pl => vini} ;
g = g
} ;
regNoun : Str -> Noun = \vino -> case vino of {
fuo + c@("c"|"g") + "o" => mkNoun vino (fuo + c + "hi") Masc ;
ol + "io" => mkNoun vino (ol + "i") Masc ;
vin + "o" => mkNoun vino (vin + "i") Masc ;
cas + "a" => mkNoun vino (cas + "e") Fem ;
pan + "e" => mkNoun vino (pan + "i") Masc ;
_ => mkNoun vino vino Masc
} ;
mkAdj : (_,_,_,_ : Str) -> Bool -> Adj = \buono,buona,buoni,buone,p -> {
s = table {
Masc => table {Sg => buono ; Pl => buoni} ;
Fem => table {Sg => buona ; Pl => buone}
} ;
isPre = p
} ;
regAdj : Str -> Adj = \nero -> case nero of {
ner + "o" => mkAdj nero (ner + "a") (ner + "i") (ner + "e") False ;
verd + "e" => mkAdj nero nero (verd + "i") (verd + "i") False ;
_ => mkAdj nero nero nero nero False
} ;
mkVerb : (_,_,_,_,_,_,_,_ : Str) -> Aux -> Verb =
\amare,amo,ami,ama,amiamo,amate,amano,amato,aux -> {
s = table {
VInf => amare ;
VPres Sg Per1 => amo ;
VPres Sg Per2 => ami ;
VPres Sg Per3 => ama ;
VPres Pl Per1 => amiamo ;
VPres Pl Per2 => amate ;
VPres Pl Per3 => amano ;
VPart g n => (regAdj amato).s ! g ! n
} ;
aux = aux
} ;
regVerb : Str -> Verb = \amare -> case amare of {
am + "are" => mkVerb amare (am+"o") (am+"i") (am+"a")
(am+"iamo") (am+"ate") (am+"ano") (am+"ato") Avere ;
tem + "ere" => mkVerb amare (tem+"o") (tem+"i") (tem+"e")
(tem+"iamo") (tem+"ete") (tem+"ono") (tem+"uto") Avere ;
fin + "ire" => mkVerb amare (fin+"isco") (fin+"isci") (fin+"isce")
(fin+"iamo") (fin+"ite") (fin+"iscono") (fin+"ito") Avere
} ;
-- for structural words
adjDet : Adj -> Number -> {s : Gender => Case => Str ; n : Number} =
\adj,n -> {
s = \\g,c => prepCase c ++ adj.s ! g ! n ;
n = n
} ;
pronNP : (s,a,d : Str) -> Gender -> Number -> Person -> NP =
\s,a,d,g,n,p -> {
s = table {
Nom => {clit = [] ; obj = s ; isClit = False} ;
Acc => {clit = a ; obj = [] ; isClit = True} ;
Dat => {clit = d ; obj = [] ; isClit = True}
} ;
a = Ag g n p
} ;
-- phonological auxiliaries
vowel : pattern Str = #("a" | "e" | "i" | "o" | "u" | "h") ;
s_impuro : pattern Str = #("z" | "s" + ("b"|"c"|"d"|"f"|"m"|"p"|"q"|"t")) ;
elisForms : (_,_,_ : Str) -> Str = \lo,l',il ->
pre {#s_impuro => lo ; #vowel => l' ; _ => il} ;
}

View File

@@ -1,45 +0,0 @@
interface Syntax = Grammar -
[UseCl,PredVP,ComplV2,UseV,DetCN,ModCN,CompAP,AdAP,
UseN,UseA,Pres,Perf,Pos,Neg] **
open Grammar in {
oper
mkS = overload {
mkS : Cl -> S = UseCl Pres Pos ;
mkS : Tense -> Cl -> S = \t -> UseCl t Pos ;
mkS : Pol -> Cl -> S = UseCl Pres ;
mkS : Tense -> Pol -> Cl -> S = UseCl ;
} ;
mkCl = overload {
mkCl : NP -> V -> Cl = \np,v -> PredVP np (UseV v) ;
mkCl : NP -> V2 -> NP -> Cl = \np,v,o -> PredVP np (ComplV2 v o) ;
mkCl : NP -> A -> Cl = \np,a -> PredVP np (CompAP (UseA a)) ;
mkCl : NP -> AP -> Cl = \np,ap -> PredVP np (CompAP ap) ;
mkCl : NP -> VP -> Cl = PredVP ;
} ;
mkAP = overload {
mkAP : A -> AP = UseA ;
mkAP : AdA -> AP -> AP = AdAP ;
} ;
mkNP = overload {
mkNP : Det -> N -> NP = \d,n -> DetCN d (UseN n) ;
mkNP : Det -> CN -> NP = \d,n -> DetCN d n ;
} ;
mkCN = overload {
mkCN : N -> CN = UseN ;
mkCN : A -> N -> CN = \a,n -> ModCN (UseA a) (UseN n) ;
mkCN : A -> CN -> CN = \a,n -> ModCN (UseA a) n ;
mkCN : AP -> N -> CN = \a,n -> ModCN a (UseN n) ;
mkCN : AP -> CN -> CN = \a,n -> ModCN a n ;
} ;
presTense : Tense = Pres ;
perfTense : Tense = Perf ;
posPol : Pol = Pos ;
negPol : Pol = Neg ;
}

View File

@@ -1,3 +0,0 @@
instance SyntaxIta of Syntax = GrammarIta -
[PredVP,ComplV2,UseV,DetCN,ModCN,CompAP,AdAP,UseN,UseA] **
open GrammarIta in {} ;

View File

@@ -1,9 +0,0 @@
abstract Test = Grammar ** {
fun
man_N, woman_N, house_N, tree_N : N ;
big_A, small_A, green_A : A ;
walk_V, arrive_V : V ;
love_V2, please_V2 : V2 ;
} ;

View File

@@ -1,17 +0,0 @@
concrete TestIta of Test = GrammarIta ** open ParadigmsIta in {
lin
man_N = mkN "uomo" "uomini" masculine ;
woman_N = mkN "donna" ;
house_N = mkN "casa" ;
tree_N = mkN "albero" ;
big_A = preA (mkA "grande") ;
small_A = preA (mkA "piccolo") ;
green_A = mkA "verde" ;
walk_V = mkV "camminare" ;
arrive_V = essereV (mkV "arrivare") ;
love_V2 = mkV2 "amare" ;
please_V2 = mkV2 (essereV (mkV "piacere" "piaccio" "piaci" "piace"
"piacciamo" "piacete" "piacciono" "piaciuto")) dative ;
} ;

65
css/newstyle.css Normal file
View File

@@ -0,0 +1,65 @@
@import url(style.css);
body.new { margin: 0 8px; }
div.header { text-align: center; }
div.sky {
margin: 0 -8px;
background-image: -webkit-linear-gradient(top, #a8d8ff, #f6f6f6 70%);
background-image: -moz-linear-gradient(top, #a8d8ff, #f6f6f6 70%);
}
div.header h1 {
margin: 0;
font-family: verdana, arial, sans-serif;
font-weight: normal; font-size: 200%;
/*text-decoration: underline;*/
}
.tagline { font-family: sans-serif; }
h2.noclear { clear: none; }
div.red h1 {
color: #e80000;
text-shadow: rgba(232,0,0,0.25) 2px 2px 5px;
}
div.red .tagline { color: #e00000; }
div.blue h1, div.blue .tagline { color: #06c; }
div.links {
display: inline-block;
vertical-align: top;
margin-right: 1em;
}
.links h4 { margin: 0; }
.links ul {
margin-top: 1ex;
margin-left: 2ex;
padding-left: 1ex;
font-family: sans-serif;
}
.links li { margin-top: 0.5ex; margin-bottom: 0.5ex; }
div.menu {
font-size: 80%;
display: table;
margin-top: 3ex;
margin-right: auto;
margin-left: auto;
/*float: right;*/
/*border-radius: 5px;
margin-top: 1ex;
background: inherit;
border: 2px solid black;
padding-left: 0.3em;
box-shadow: 0px 0px 15px rgba(0,0,0,0.5);*/
}
.gflogo { width: 240px; }

4
css/notes.css Normal file
View File

@@ -0,0 +1,4 @@
@import url(style.css);
body { color: #333; }
li>code, p>code, pre { color: #730; }

View File

@@ -1,20 +1,20 @@
body { background-color: #f2f2f2; }
h1,h2,h3 { font-family: sans-serif; }
h1 { text-align: center; }
h2 { border-bottom: 2px solid black; clear: right; }
div.center { text-align: center; }
div.news { font-size: small; }
@import url(style0.css);
table { border-collapse: collapse; }
table.news td {
background: inherit;
border: 0;
vertical-align: baseline;
padding: 0.25ex 0.5ex;
}
table.news td:nth-child(1) {
/* Don't want the hyphens in dates (2012-06-29) to cause line breaks */
white-space: nowrap;
}
th,td { border: 1px solid #333; }
td { background: white; }
th { background: #9df; }
h1>img { float: right; }

45
css/style0.css Normal file
View File

@@ -0,0 +1,45 @@
body { background-color: #f6f6f6; }
h1,h2,h3,h4 { font-family: sans-serif; color: #303030;
text-shadow: rgba(0,0,0,0.25) 2px 2px 5px;
}
h1 { text-align: center; }
h2 { border-bottom: 2px solid #303030; clear: right; }
div.mainlinks { font-size: 140%; }
div.center { text-align: center; }
div.news { font-size: small; }
h1 img { float: right; border: 0; }
h1 img.nofloat { float: none; }
img.right { float: right; }
ol.languages {
column-width: 12em;
}
.grow {
max-width: 75%;
animation-name: grow;
animation-duration: 2s;
animation-timing-function: ease-in-out;
-webkit-animation-name: grow;
-webkit-animation-duration: 2s;
-webkit-animation-timing-function: ease-in-out;
}
@keyframes grow {
from,50% { opacity: 0; transform: scale(0.1,0.1); }
80% { opacity: 1; transform: scale(1.1,1.1); }
to { transform: scale(1.0,1.0); }
}
@-webkit-keyframes grow {
from,50% { opacity: 0; -webkit-transform: scale(0.1,0.1); }
80% { opacity: 1; -webkit-transform: scale(1.1,1.1); }
to { -webkit-transform: scale(1.0,1.0); }
}

80
debian/changelog vendored
View File

@@ -1,5 +1,83 @@
gf (3.10.3-1) xenial bionic cosmic; urgency=low
* GF 3.10.3
-- Thomas Hallgren <hallgren@chalmers.se> Fri, 5 Mar 2019 19:30:00 +0100
gf (3.10-2) xenial bionic cosmic; urgency=low
* GF 3.10
-- Thomas Hallgren <hallgren@chalmers.se> Fri, 5 Mar 2019 16:00:00 +0100
gf (3.10-1) xenial bionic cosmic; urgency=low
* GF 3.10
-- Thomas Hallgren <hallgren@chalmers.se> Fri, 2 Dec 2018 15:00:00 +0100
gf (3.9-1) vivid xenial zesty; urgency=low
* GF 3.9
-- Thomas Hallgren <hallgren@chalmers.se> Fri, 11 Aug 2017 20:00:00 +0200
gf (3.8-1) precise trusty vivid; urgency=low
* GF 3.8
-- Thomas Hallgren <hallgren@chalmers.se> Wed, 22 Jun 2016 14:00:00 +0200
gf (3.7.1-1) precise trusty vivid; urgency=low
* GF 3.7.1
-- Thomas Hallgren <hallgren@chalmers.se> Fri, 2 Oct 2015 14:00:00 +0200
gf (3.7-1) precise trusty vivid; urgency=low
* GF 3.7
-- Thomas Hallgren <hallgren@chalmers.se> Tue, 25 Jun 2015 14:00:00 +0200
gf (3.6-1) precise saucy trusty; urgency=low
* GF 3.6
-- Thomas Hallgren <hallgren@chalmers.se> Tue, 21 Jun 2014 20:00:00 +0200
gf (3.5-1) precise quantal; urgency=low
* GF 3.5
-- Thomas Hallgren <hallgren@chalmers.se> Tue, 6 Aug 2013 17:30:00 +0200
gf (3.4-1) precise quantal; urgency=low
* GF 3.4
-- Thomas Hallgren <hallgren@chalmers.se> Wed, 31 Dec 2012 00:00:00 +0200
gf (3.3.11-1) oneiric precise quantal; urgency=low
* GF 3.3.11
-- Thomas Hallgren <hallgren@chalmers.se> Wed, 7 Dec 2012 16:50:00 +0200
gf (3.3.3-1) oneiric precise; urgency=low
* GF 3.3.3
-- Thomas Hallgren <hallgren@chalmers.se> Wed, 22 Aug 2012 16:50:00 +0200
gf (3.3-1) natty; urgency=low
* GF 3.3.
-- Thomas Hallgren <th0907@altocumulus.org> Wed, 26 Oct 2011 22:10:42 +0200
gf (2.5-1) unstable; urgency=low
* Initial packaging.
-- Bjorn Bringert <bringert@cs.chalmers.se> Tue, 21 Mar 2006 11:12:25 +0100

1
debian/compat vendored Normal file
View File

@@ -0,0 +1 @@
7

10
debian/control vendored
View File

@@ -1,9 +1,10 @@
Source: gf
Section: devel
Priority: optional
Section: science
Maintainer: Bjorn Bringert <bringert@cs.chalmers.se>
Build-Depends: debhelper, autoconf, ghc6 (>= 6.4.1-1)
Standards-Version: 3.6.2
Maintainer: Thomas Hallgren <hallgren@chalmers.se>
Standards-Version: 3.9.2
Build-Depends: debhelper (>= 5), haskell-platform (>= 2011.2.0.1), libghc-haskeline-dev, libghc-mtl-dev, libghc-json-dev, autoconf, automake, libtool-bin, python-dev, java-sdk, txt2tags, pandoc
Homepage: http://www.grammaticalframework.org/
Package: gf
Architecture: any
@@ -13,4 +14,3 @@ Description: Tools for GF, a grammar formalism based on type theory
It consists of a special-purpose programming language,
a compiler of the language, and a generic grammar processor.
.
Homepage: http://www.cs.chalmers.se/~aarne/GF/

19
debian/copyright vendored
View File

@@ -1,18 +1 @@
This package was Debianized by Bjorn Bringert <bringert@cs.chalmers.se>
on 2006-03-21.
The upstream sources for this version come from the GF darcs repository
at http://www.cs.chalmers.se/Cs/Research/Language-technology/darcs/GF/
Authors and copyright licenses:
Copyright (C):
Bjorn Bringert, Hakan Burden, Hans-Joachim Daniels, Markus Forsberg,
Thomas Hallgren, Harald Hammarstrom, Kristofer Johannisson,
Janna Khegai, Peter Ljunglof, Petri Maenpaa, and Aarne Ranta,
1998-2006.
You are free to distribute this software under the terms of
the GNU General Public License.
On Debian systems, the complete text of the GNU General Public
License can be found in the file /usr/share/common-licenses/GPL.
/usr/share/common-licenses/GPL-2

142
debian/rules vendored Normal file → Executable file
View File

@@ -1,102 +1,52 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
%:
+dh $@
#dh_shlibdeps has a problem finding which package some of the Haskell
#libraries come from, even though dpkg-query -S has no problem finding them.
#But the gf executable is statically linked against the Haskell libraries, so
#it will work even if these shared libraries aren't installed. But there will
#be a problem if other shared libraries are missing (.e.g. libtinfo, libgmp),
#so we need a better solution than simply ignoring all dependency problems...
#See also http://stackoverflow.com/questions/11238134/dpkg-shlibdeps-error-no-dependency-information-found-for
override_dh_shlibdeps:
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
override_dh_auto_configure:
cd src/runtime/c && bash setup.sh configure --prefix=/usr
cd src/runtime/c && bash setup.sh build
cabal update
cabal install --only-dependencies
cabal configure --prefix=/usr -fserver -fc-runtime --extra-lib-dirs=$(CURDIR)/src/runtime/c/.libs --extra-include-dirs=$(CURDIR)/src/runtime/c
# FOR AUTOCONF 2.52 AND NEWER ONLY
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
confflags += --build $(DEB_HOST_GNU_TYPE)
else
confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
SET_LDL=LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(CURDIR)/src/runtime/c/.libs
override_dh_auto_build:
cd src/runtime/python && EXTRA_INCLUDE_DIRS=$(CURDIR)/src/runtime/c EXTRA_LIB_DIRS=$(CURDIR)/src/runtime/c/.libs python setup.py build
cd src/runtime/java && make CFLAGS="-I$(CURDIR)/src/runtime/c -L$(CURDIR)/src/runtime/c/.libs" INSTALL_PATH=/usr/lib
echo $(SET_LDL)
-$(SET_LDL) cabal build # builds gf, fails to build example grammars
export $(SET_LDL); PATH=$(CURDIR)/dist/build/gf:$$PATH && make -C ../gf-rgl build
GF_LIB_PATH=$(CURDIR)/../gf-rgl/dist $(SET_LDL) cabal build # have RGL now, ok to build example grammars
make html
override_dh_auto_install:
$(SET_LDL) cabal copy --destdir=$(CURDIR)/debian/gf # creates www directory
export GF_LIB_PATH="$$(dirname $$(find "$(CURDIR)/debian/gf" -name www))/lib" && echo "GF_LIB_PATH=$$GF_LIB_PATH" && mkdir -p "$$GF_LIB_PATH" && make -C ../gf-rgl copy
cd src/runtime/c && bash setup.sh copy prefix=$(CURDIR)/debian/gf/usr
cd src/runtime/python && python setup.py install --prefix=$(CURDIR)/debian/gf/usr
cd src/runtime/java && make INSTALL_PATH=$(CURDIR)/debian/gf/usr/lib install
D="`find debian/gf -name site-packages`" && [ -n "$$D" ] && cd $$D && cd .. && mv site-packages dist-packages
override_dh_auto_clean:
rm -fr dist/build
-cd src/runtime/python && rm -fr build
-cd src/runtime/java && make clean
-cd src/runtime/c && make clean
override_dh_auto_test:
ifneq (nocheck,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
true
# cabal test
endif
configure: configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.
cd src && autoconf
touch configure-stamp
build: build-stamp
build-stamp: configure-stamp
dh_testdir
# Add here commands to compile the package.
cd src && ./configure $(confflags)
$(MAKE) -C src unix gfdoc
#docbook-to-man debian/gf.sgml > gf.1
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
-$(MAKE) -C src clean
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/gf.
$(MAKE) -C src install-gf install-gfdoc prefix=$(CURDIR)/debian/gf
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_installexamples
# dh_install
# dh_installmenu
# dh_installdebconf
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_installinit
# dh_installcron
# dh_installinfo
dh_installman
dh_link
dh_strip
dh_compress
dh_fixperms
# dh_perl
# dh_python
# dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure

1
debian/source/format vendored Normal file
View File

@@ -0,0 +1 @@
3.0 (native)

2
debian/watch vendored Normal file
View File

@@ -0,0 +1,2 @@
version=3
http://hackage.haskell.org/packages/archive/gf/([\d\.]+)/gf-([\d\.]+).tar.gz

138
demos/app.html Normal file
View File

@@ -0,0 +1,138 @@
<!DOCTPYE html>
<html>
<head>
<link rel=stylesheet href="../css/style0.css">
<meta name = "viewport" content = "width = device-width">
<link rel=top href="../" title="GF">
</head>
<body>
<h1>GF Offline Translator - a mobile speech and text translation app
for Android and iOS</h1>
<center>
<img src="images/app-trans.png" width=200>
</center>
<p>
Android: download for free from <a
href="https://play.google.com/store/apps/details?id=org.grammaticalframework.ui.android">Play
Store</a>!
Or take the <a
href="http://www.grammaticalframework.org/~aarne/App14.apk">current
development version</a>.
<br>
iOS (iPhone, iPad): coming in June 2015.
</p>
<p>
Or try first a
<a href="http://cloud.grammaticalframework.org/wc.html">web version of the translator</a>
</p>
<p>
GF Offline Translator is based on grammar and semantics. It is compact in size
and gives control on quality. Its technology is inspired by compilers, which are
programs that translate computer languages.
Most other translators for human language are based on
statistics and have less control of quality and are much bigger, so that
they require either an internet connection or a huge storage on your phone.
</p>
The app indicates translation confidence with colours:
<ul>
<li><b>Green</b>:
semantic translation, should be correct.
But not necessarily the only correct one.
You can tap the output to see alternatives.
</li>
<li><b>Yellow</b>:
syntactic translation, should be grammatically correct.
But can be very strange in its interpretation and choice of words.
</li>
<li><b>Light red</b>:
chunk translation, probably incorrect.
Builds the translation from small pieces.
</li>
<li><b>Dark red</b>:
word-by-word translation, almost certainly incorrect.
Builds the translation word by word.
</li>
</ul>
The green translations come from a tourist phrasebook, which allows
you to translate things like "hello" and "how far is the airport from
the hotel".
</p>
<p>
You can translate both speech and text, as selected in the menu in the
upper right corner. Both kinds of input can be edited with the
keyboard by first tapping at the input field. This is often needed
because of <b>speech recognition errors</b>. Changing words
from <b>upper to lower case</b> may also be needed.
At the moment, <b>Japanese</b> and <b>Thai</b> input must be separated
to words, whereas Chinese works without spaces.
</p>
<p>
Translation works between any of the 14 supported languages, which means 182
language pairs in the current development version (the official
Android version has 12 languages).
But different languages are on different levels of development.
The following table gives a rough idea of what to expect:
</p>
<p>
<center>
<table rules=all border=yes>
<tr> <th></th> <th>coverage</th> <th>quality</th> <th>speed</th> <th>speech</th> </tr>
<tr> <th>Bulgarian</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td><td bgcolor=palegreen></td> <td bgcolor=yellow>in only</td></tr>
<tr> <th>Catalan</th> <td bgcolor=pink></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=yellow>in only</td></tr>
<tr> <th>Chinese</th> <td bgcolor=pink></td> <td bgcolor=pink></td> <td bgcolor=palegreen></td> <td bgcolor=yellow></td> </tr>
<tr> <th>Dutch</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td> <td bgcolor=yellow></td> <td bgcolor=palegreen></td> </tr>
<tr> <th>English</th> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> </tr>
<tr> <th>Finnish</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=yellow>in only</td></tr>
<tr> <th>French</th> <td bgcolor=pink></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr>
<tr> <th>German</th> <td bgcolor=pink></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr>
<tr> <th>Hindi</th> <td bgcolor=pink></td> <td bgcolor=red></td> <td bgcolor=yellow></td> <td bgcolor=yellow>in only</td> </tr>
<tr> <th>Italian</th> <td bgcolor=pink></td> <td bgcolor=pink></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr>
<tr> <th>Japanese</th> <td bgcolor=pink></td> <td bgcolor=pink></td><td bgcolor=yellow></td> <td bgcolor=palegreen></td></tr>
<tr> <th>Spanish</th> <td bgcolor=pink></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr>
<tr> <th>Swedish</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td> <td bgcolor=palegreen></td> <td bgcolor=yellow>in only</td></tr>
<tr> <th>Thai</th> <td bgcolor=pink></td> <td bgcolor=pink></td><td bgcolor=yellow></td> <td bgcolor=palegreen></td></tr>
</table>
</center>
</p>
<p>
The speech input and output use Google's voice services. Their status
can hence change without notice. You can make it more stable by
installing third-party speech tools, such as SVOX, which provides
output for most of the listed languages.
</p>
<p>
When you tap on a translation you get a screen with <b>alternative translations</b>.
Tapping on each of the alternatives
gives you <b>grammatical information</b>:
an inflection table, if it is a single word,
and a syntax tree otherwise.
</p>
<p>
Powered by <a href="http://www.grammaticalframework.org/">GF</a>,
built by support from the GF community and from <a href="http://www.digitalgrammars.com/">Digital Grammars</a>.
</p>
<p>
Publication: <a
href="http://www.aclweb.org/anthology/E/E14/E14-2011.pdf">EACL 2014
demo paper</a>
</p>
<center>
<img src="images/app-table.png" width=160>
<img src="images/app-disamb.png" width=160>
</center>
</body>
</html>

BIN
demos/images/app-disamb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

BIN
demos/images/app-table.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

BIN
demos/images/app-trans.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

View File

@@ -1,43 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
<TITLE>Portable Numeral Translator</TITLE>
</HEAD><BODY BGCOLOR="white" TEXT="black">
<P ALIGN="center"><CENTER><H1>Portable Numeral Translator</H1>
<FONT SIZE="4">
<I>15 August 2008</I><BR>
</FONT></CENTER>
<P>
Here is the first GF application for the iPhone. It translates
numerals from digits into number words in 15 languages. It works for
numerals in the range 1-999,999. You can use the demo online in your iPhone's
browser, or download and install it by using FileMagnet (from AppStore).
</P>
<P>
The demo should work in any web browser supporting JavaScript, but it has been
specially dimensioned for the iPhone screen. It is an application of a general
technology, namely the compilation of GF grammars to JavaScript. Thus you can
easily build similar applications from your own grammars.
</P>
<P>
The
<A HREF="http://www.cs.chalmers.se/~bringert/gf/translate/">full numeral translator</A>, which
works in 88 language and permits arbitrary cross translations, cannot yet be ported
to the iPhone because of memory problems.
</P>
<P>
The current version has some encoding/font issues in Hebrew and Hindi.
</P>
<P>
<A HREF="numbers/numbers.html">Use the translator online</A>
</P>
<P>
<A HREF="numbers.tgz">Download the translator</A>. To install: unpack the file and move
the directory <CODE>numbers</CODE> to your FileMagnet uploader.
</P>
<!-- html code generated by txt2tags 2.4 (http://txt2tags.sf.net) -->
<!-- cmdline: txt2tags -thtml index-numbers.txt -->
</BODY></HTML>

View File

@@ -1,48 +1,60 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<HTML>
<HEAD>
<TITLE>Grammatical Framework Demos</TITLE>
<link rel=stylesheet href="../css/style.css">
<meta name = "viewport" content = "width = device-width">
<link rel=top href="../" title="GF">
</HEAD>
<BODY>
<H1><IMG SRC="../doc/Logos/gf0.png" alt="">Grammatical Framework Demos</H1>
<H1><a href="../"><IMG SRC="../doc/Logos/gf0.png" alt=""></a>Grammatical Framework Demos</H1>
<p>
<a href="http://www.grammaticalframework.org/demos/phrasebook/">Tourist
<p><a href="translation.html">Wide coverage translation with GF</a>
<p><a href="app.html">The GF Offline Translation App</a>:
a mobile speech and text translation app for Android and iOS.
<p><a href="http://www.grammaticalframework.org/demos/phrasebook/">Tourist
Phrasebook</a>
<p>
<strong>NEW</strong>
<a href="TransQuiz/">Translation Quiz</a>
<p><a href="http://www.phrasomatic.net/">Phrasomatic</a> (conceptual authoring based on Phrasebook)
<P>
<A HREF="http://www.grammaticalframework.org:41296/minibar/minibar.html">Minibar
online</A>
| <small><a href="http://www.grammaticalframework.org/~hallgren/hs2js/test/">Minibar offline</a></small>
<P>
<A HREF="http://www.grammaticalframework.org:41296/fridge">Fridge poetry</A>
<p><a href="multilingual_headlines.html">Multilingual Headlines</a>
<P>
<A HREF="http://www.grammaticalframework.org:41296/translate">Word-completing translator</A>
<p><a href="molto.html">MOLTO Application Grammars</a>
<p><a href="mathbar/">Mathbar</a>
<p><a href="http://cloud.grammaticalframework.org/gfse/">GF online editor for simple multilingual grammars</a>
<!--<br>(there is also an <a href="gfse/">older prototype</a>)-->
<p><a href="http://www.grammaticalframework.org:41297/syllogism/syllogism.html">Online syllogism solver</a>
<p><a href="../src/www/TransQuiz/translation_quiz.html">Translation Quiz</a>
<P><a href="http://cloud.grammaticalframework.org/minibar/minibar.html">Minibar</A>
<!-- | <small><a href="../src/www/minibar/minibar_offline.html">Minibar offline</a></small> -->
<!--(<small>Predecessors:
<a href="http://www.grammaticalframework.org:41296/fridge">Fridge poetry</A>
| <a href="http://www.grammaticalframework.org:41296/translate">Word-completing translator</A></small>)-->
<p><a href="http://www.grammaticalframework.org/~hallgren/Talks/GF/Tutorial2012/Ex4/answer.html">Question answering demo</a> for simple math questions.
<P>
<A HREF="http://www.youtube.com/watch?v=1bfaYHWS6zU">Tramdemo on YouTube</A>:
find your way in Gothenburg public transport system, in six languages (film).
<P>
<!-- <B>NEW</B> <A HREF="http://csmisc14.cs.chalmers.se/~meza/restWiki/wiki.cgi">Multilingual Wiki</A>. -->
<A HREF="http://www.grammaticalframework.org/~meza/restWiki/wiki.cgi">Multilingual Wiki</A>.
<P>
<A HREF="index-numbers.html">Numeral translator for the iPhone</A>: number words in 15 languages.
<P>
<A HREF="http://www.cse.chalmers.se/alumni/bringert/gf/translate/">Numeral translator</A>:
number words in 88 languages.
number words in 88 languages. (Java applet)
<P>
<A HREF="http://www.cse.chalmers.se/alumni/markus/gramlets/letter-applet.html">Letter editor</A>: compose
a letter in a language you don't know.
a letter in a language you don't know. (Java applet)
<P>
<A HREF="http://www.cse.chalmers.se/alumni/bringert/xv/pizza/">Pizza</A>: order a pizza by speaking
@@ -51,13 +63,17 @@ to your web browser.
<P>
<A HREF="http://webalt.math.helsinki.fi/PublicFiles/CD/Screencast/TextMathEditor%20Demo.swf">WebALT Math Editor</A>:
create mathematical exercises in six languages simultaneously (film).
<!--
<P>
[Out of order, early May 2012]
<small>
<A HREF="http://www.jem-thematic.net/en/node/846#comment-209">WebALT Math translator</A>:
translate mathematical exercises in a web service using incremental parsing.
</small>
-->
<!--
<P>
<!-- <A HREF="http://csmisc14.cs.chalmers.se/~bjorn/langtrain.cgi">GF Language Trainer</A>:
<A HREF="http://csmisc14.cs.chalmers.se/~bjorn/langtrain.cgi">GF Language Trainer</A>:
translation quizzes in Arabic, English, Russian, Swedish. -->
<P>
@@ -69,3 +85,5 @@ the <A HREF="../lib/doc/synopsis.html">GF resource library</A>
<A HREF="../old-lib/resource/doc/resdemo.html">Random library examples</A>
-->
<hr>
<a href="http://www.grammaticalframework.org/">www.grammaticalframework.org</a>

49
demos/molto.html Normal file
View File

@@ -0,0 +1,49 @@
<!DOCTYPE html>
<html>
<head>
<title>MOLTO Application Grammars</title>
<link rel=stylesheet type="text/css" href="../src/www/minibar/minibar.css">
<link rel=stylesheet type="text/css" href="../src/www/syntax-editor/editor.css">
<link rel=author href="http://www.cse.chalmers.se/~hallgren/" title="Thomas Hallgren">
<meta name = "viewport" content = "width = device-width">
<meta charset="UTF-8">
</head>
<body class=minibar>
<h2>MOLTO Application Grammars</h2>
<div id=minibar></div>
<div id=syntax_editor></div>
<noscript>This page doesn't works unless JavaScript is enabled.</noscript>
<hr>
<small>
[<a href="http://www.molto-project.eu/cloud/gf-application-grammars">GF
Application Grammars on the MOLTO web site</a>]
</small>
<small class=modtime>
HTML <!-- hhmts start -->Last modified: Fri May 24, 2013 <!-- hhmts end -->
</small>
<div id="debug" class="hidden"></div>
<script type="text/JavaScript" src="../src/www/js/grammar_manager.js"></script>
<script type="text/JavaScript" src="../src/www/js/support.js"></script>
<script type="text/JavaScript" src="../src/www/js/localstorage.js"></script>
<script type="text/JavaScript" src="../src/www/minibar/minibar.js"></script>
<script type="text/JavaScript" src="../src/www/minibar/minibar_input.js"></script>
<script type="text/JavaScript" src="../src/www/minibar/minibar_translations.js"></script>
<script type="text/JavaScript" src="../src/www/minibar/minibar_support.js"></script>
<script type="text/JavaScript" src="../src/www/js/pgf_online.js"></script>
<script type="text/javascript" src="../src/www/syntax-editor/ast.js"></script>
<script type="text/javascript" src="../src/www/syntax-editor/editor_menu.js"></script>
<script type="text/javascript" src="../src/www/syntax-editor/editor.js"></script>
<script type="text/javascript" src="molto_grammars.js"></script>
<script type="text/javascript" src="../src/www/gfse/gf_abs.js"></script>
</body>
</html>

19
demos/molto_grammars.js Normal file
View File

@@ -0,0 +1,19 @@
var online_options={
grammars_url: "/grammars/molto/"
}
var minibar_options= {
show_abstract: true,
show_trees: true,
tree_img_format: "svg", // or "png"
show_grouped_translations: false,
to_multiple: false,
show_brackets: true,
word_replacements: true,
default_source_language: "Eng",
feedback_url: "feedback.html",
try_google: true
}
var server=pgf_online(online_options);
var minibar=new Minibar(server,minibar_options);

View File

@@ -0,0 +1,19 @@
Computational Grammars for the World
The GF Resource Grammar Library
Did you ever struggle with the inflection of French verbs? Or with getting the words in a German sentence into the right order?
Don't worry: these problems are as easy for a computer as to calculate 2+2. This page will give you access to computer programs that
- help you construct sentences and other expressions
- help you inflect words
- help you covert sentences to different tenses, and other similar operations
- help you compare languages by translating them and linking corresponding parts
- allow you to practice your language skills by automatically generated and graded exercises
- explain grammar rules in a mathematically precise and shortest possible manner
//Coming soon!// for 29 languages.
Powered by [GF ..] and its [Resource Grammar Library ../lib/doc/synopsis.html]

100
demos/translation.t2t Normal file
View File

@@ -0,0 +1,100 @@
Translation with GF
Powered by multilingual grammars
%!style:../css/style0.css
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.svg" alt=""></a>
%!postproc(html): #GFWCT <iframe style="border: 0; width: 100%; height: 50ex;" src="http://cloud.grammaticalframework.org/wc.html#embed"></iframe>
==Try it online==
%**Coming soon**:
%//Here you will be able to select your source and target language and translate% whatever you want.//
#GFWCT
==Download the app==
[App description and download page ./app.html]
==Colours==
- **Green: semantic translation**, should be correct.
But not necessarily the only correct one.
- **Yellow: syntactic translation**, should be grammatically correct.
But can be very strange in its interpretation and choice of words.
- **Light red: chunk translation**, probably incorrect.
Builds the translation from small pieces.
- **Dark red: word-by-word translation**, almost certainly incorrect.
Builds the translation word by word and returns unknown words verbatim.
The green translations currently come from a tourist phrasebook, which allows
you to translate things like "hello" and "how far is the airport from
the hotel". But this part can be easily adapted to other uses, such as
technical language.
==What you can expect==
The program is designed to translate anything, just like Google translate and Bing. It has some advantages over them:
- It uses **grammars** (as opposed to statistics), which makes it more correct in many cases.
- It is **open source**, which means you can inspect, copy, and modify it in what ever way you want.
- It is **light weight**, so that you can run it on your own computer and even on a smartphone.
- It gives you **linguistic information**, such as word inflections.
- It gives you **confidence information**, warning about translations that it is not so sure about.
However, this is not a mature product but a research prototype. It therefore has some shortcomings:
- It has **limited coverage**, which means that it misses many words and syntactic constructions.
- It can be **clumsy**, for instance when it doesn't detect an idiom but translates too literally.
- It can be **slow**, in particular with long sentences and with some input languages.
Here are some hints to use it in a satisfactory way:
- Start with short sentences (less than ten words), preferably from English or Swedish, to get an idea of the best performance.
- Take a look at the alternative translations, in particular for sentences with low confidence level.
- Send us feedback, and consider contributing to the improvement of the system!
The following table gives a rough idea of what to expect for each
language (the speech column refers to the Android app):
'''
<center>
<table rules=all border=yes>
<tr> <th></th> <th>coverage</th> <th>quality</th> <th>speed</th> <th>speech</th> </tr>
<tr> <th>Bulgarian</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td><td bgcolor=palegreen></td> <td bgcolor=yellow>in only</td></tr>
<tr> <th>Chinese</th> <td bgcolor=pink></td> <td bgcolor=pink></td> <td bgcolor=palegreen></td> <td bgcolor=yellow>diff in/out</td> </tr>
<tr> <th>Dutch</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td> <td bgcolor=yellow></td> <td bgcolor=palegreen></td> </tr>
<tr> <th>English</th> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> </tr>
<tr> <th>Finnish</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr>
<tr> <th>French</th> <td bgcolor=pink></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr>
<tr> <th>German</th> <td bgcolor=pink></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr>
<tr> <th>Hindi</th> <td bgcolor=pink></td> <td bgcolor=pink></td> <td bgcolor=yellow></td> <td bgcolor=yellow>out only</td> </tr>
<tr> <th>Italian</th> <td bgcolor=pink></td> <td bgcolor=pink></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr>
<tr> <th>Spanish</th> <td bgcolor=pink></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr>
<tr> <th>Swedish</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> </tr>
</table>
</center>
'''
==How it works==
Powered by [Grammatical Framework ../]
[Slides https://docs.google.com/presentation/d/1545yYmTlWgzyV1uwUwuvAsOCzdD1AIUdV_NZbZ1qMEo/edit?usp=sharing]
explaining the translation method:
==Get the sources==
Download from [here ../download/]
==Send us feedback==

View File

@@ -1 +1 @@
<?xml version="1.0" standalone="no"?>
<?xml version="1.0" standalone="no"?>

Before

Width:  |  Height:  |  Size: 452 B

After

Width:  |  Height:  |  Size: 450 B

14
doc/Logos/gf1.svg Normal file
View File

@@ -0,0 +1,14 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="240" height="240" version="1.1" xmlns="http://www.w3.org/2000/svg">
<filter id="A"><feGaussianBlur stdDeviation="2"/></filter>
<path filter="url(#A)"
d="M120,227.5 v-51 h59 m-59,0 v-53 h114 a110.5,105 0 1,1 -24,-66"
fill="none" stroke="black" stroke-width="4" opacity="0.25"
stroke-linejoin="round" stroke-linecap="round"/>
<path d="M120,225.5 v-51 h59 m-59,0 v-53 h114 a110.5,105 0 1,1 -24,-66"
fill="none" stroke="red" stroke-width="4"
stroke-linejoin="round" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 692 B

View File

@@ -1,17 +1,6 @@
resource:
gfdoc -txt2 ../lib/resource-1.0/abstract/*.gf
gfdoc -txt2 ../lib/resource-1.0/*/Paradigms*.gf
txt2tags --toc resource.txt
# cat resource-preamble resource.tex >final-resource.tex
sed -i 's/\\docum/%\\docum/g' resource.tex
sed -i 's/ion\*{/ion{/g' resource.tex
sed -i 's/\\paragraph{}//g' resource.tex
sed -i 's/}\\\\/}/g' resource.tex
cat resource-preamble resource.tex >resource.tmp
mv resource.tmp resource.tex
latex resource.tex
latex resource.tex
dvipdf resource.dvi
gf-help-full.txt::
{ echo ; echo ; echo ; } > $@
echo help -full -t2t | gf -run >> $@
### Converting SVG logos to PNG, using convert from ImageMagick
logos:: Logos/gf00.png Logos/gf0.png

551
doc/error-messages.txt Normal file
View File

@@ -0,0 +1,551 @@
Compiler.hs
mainGFC :: Options -> [FilePath] -> IO ()
_ | null fs -> fail $ "No input files."
_ | all (extensionIs ".pgf") fs -> unionPGFFiles opts fs
_ -> fail $ "Don't know what to do with these input files: " ++ unwords fs)
----------------------------------------
Compile.hs
compileModule
case length file1s of
0 -> raise (render ("Unable to find: " $$ nest 2 candidates))
1 -> do return $ head file1s
_ -> do putIfVerb opts1 ("matched multiple candidates: " +++ show file1s)
return $ head file1s
else raise (render ("File" <+> file <+> "does not exist"))
---------------------------------------
Grammar.Lexer.x
token :: P Token
AlexError (AI pos _ _) -> PFailed pos "lexical error"
---------------------------------------
Grammar.Parser.y
happyError = fail "syntax error"
tryLoc (c,mty,Just e) = return (c,(mty,e))
tryLoc (c,_ ,_ ) = fail ("local definition of" +++ showIdent c +++ "without value")
mkR [] = return $ RecType [] --- empty record always interpreted as record type
mkR fs@(f:_) =
case f of
(lab,Just ty,Nothing) -> mapM tryRT fs >>= return . RecType
_ -> mapM tryR fs >>= return . R
where
tryRT (lab,Just ty,Nothing) = return (ident2label lab,ty)
tryRT (lab,_ ,_ ) = fail $ "illegal record type field" +++ showIdent lab --- manifest fields ?!
tryR (lab,mty,Just t) = return (ident2label lab,(mty,t))
tryR (lab,_ ,_ ) = fail $ "illegal record field" +++ showIdent lab
---------------------------------------
ModDeps.hs
mkSourceGrammar :: [SourceModule] -> Err SourceGrammar
deplist <- either
return
(\ms -> Bad $ "circular modules" +++ unwords (map show ms)) $
checkUniqueImportNames :: [Ident] -> SourceModInfo -> Err ()
test ms = testErr (all (`notElem` ns) ms)
("import names clashing with module names among" +++ unwords (map prt ms))
moduleDeps :: [SourceModule] -> Err Dependencies
deps (c,m) = errIn ("checking dependencies of module" +++ prt c) $ case mtype m of
MTConcrete a -> do
am <- lookupModuleType gr a
testErr (mtype am == MTAbstract) "the of-module is not an abstract syntax"
testErr (all (compatMType ety . mtype) ests) "inappropriate extension module type"
---------------------------------------
Update.hs
buildAnyTree
Just i -> case unifyAnyInfo m i j of
Ok k -> go (Map.insert c k map) is
Bad _ -> fail $ render ("conflicting information in module"<+>m $$
nest 4 (ppJudgement Qualified (c,i)) $$
"and" $+$
nest 4 (ppJudgement Qualified (c,j)))
extendModule
unless (sameMType (mtype m) (mtype mo))
(checkError ("illegal extension type to module" <+> name))
rebuildModule
unless (null is || mstatus mi == MSIncomplete)
(checkError ("module" <+> i <+>
"has open interfaces and must therefore be declared incomplete"))
unless (isModRes m1)
(checkError ("interface expected instead of" <+> i0))
js' <- extendMod gr False ((i0,m1), isInherited mincl) i (jments mi)
unless (stat' == MSComplete || stat == MSIncomplete)
(checkError ("module" <+> i <+> "remains incomplete"))
extendMod
checkError ("cannot unify the information" $$
nest 4 (ppJudgement Qualified (c,i)) $$
"in module" <+> name <+> "with" $$
nest 4 (ppJudgement Qualified (c,j)) $$
"in module" <+> base)
unifyAnyInfo
(ResValue (L l1 t1), ResValue (L l2 t2))
| t1==t2 -> return (ResValue (L l1 t1))
| otherwise -> fail ""
(AnyInd b1 m1, AnyInd b2 m2) -> do
testErr (b1 == b2) $ "indirection status"
testErr (m1 == m2) $ "different sources of indirection"
unifAbsDefs _ _ = fail ""
----------------------------------
Rename.hs
renameIdentTerm'
_ -> case lookupTreeManyAll showIdent opens c of
[f] -> return (f c)
[] -> alt c ("constant not found:" <+> c $$
"given" <+> fsep (punctuate ',' (map fst qualifs)))
ts@(t:_) -> do checkWarn ("atomic term" <+> ppTerm Qualified 0 t0 $$
"conflict" <+> hsep (punctuate ',' (map (ppTerm Qualified 0) ts)) $$
"given" <+> fsep (punctuate ',' (map fst qualifs)))
return t
renameInfo
renLoc ren (L loc x) =
checkInModule cwd mi loc ("Happened in the renaming of" <+> i) $ do
renameTerm
| otherwise -> checks [ renid' (Q (MN r,label2ident l)) -- .. and qualified expression second.
, renid' t >>= \t -> return (P t l) -- try as a constant at the end
, checkError ("unknown qualified constant" <+> trm)
]
renamePattern env patt =
do r@(p',vs) <- renp patt
let dupl = vs \\ nub vs
unless (null dupl) $ checkError (hang ("[C.4.13] Pattern is not linear:") 4
patt)
return r
case c' of
Q d -> renp $ PM d
_ -> checkError ("unresolved pattern" <+> patt)
Q _ -> checkError ("data constructor expected but" <+> ppTerm Qualified 0 c' <+> "is found instead")
_ -> checkError ("unresolved data constructor" <+> ppTerm Qualified 0 c')
PM c -> do
x <- renid (Q c)
c' <- case x of
(Q c') -> return c'
_ -> checkError ("not a pattern macro" <+> ppPatt Qualified 0 patt)
PV x -> checks [ renid' (Vr x) >>= \t' -> case t' of
QC c -> return (PP c [],[])
_ -> checkError (pp "not a constructor")
, return (patt, [x])
-----------------------------------
CheckGrammar.hs
checkRestrictedInheritance :: FilePath -> SourceGrammar -> SourceModule -> Check ()
let illegals = [(f,is) |
(f,cs) <- allDeps, incld f, let is = filter illegal cs, not (null is)]
case illegals of
[] -> return ()
cs -> checkWarn ("In inherited module" <+> i <> ", dependence of excluded constants:" $$
nest 2 (vcat [f <+> "on" <+> fsep is | (f,is) <- cs]))
checkCompleteGrammar :: Options -> FilePath -> Grammar -> Module -> Module -> Check Module
case info of
CncCat (Just (L loc (RecType []))) _ _ _ _ -> return (foldr (\_ -> Abs Explicit identW) (R []) cxt)
_ -> Bad "no def lin"
where noLinOf c = checkWarn ("no linearization of" <+> c)
Ok (CncCat Nothing md mr mp mpmcfg) -> do
checkWarn ("no linearization type for" <+> c <> ", inserting default {s : Str}")
return $ updateTree (c,CncCat (Just (L NoLoc defLinType)) md mr mp mpmcfg) js
_ -> do
checkWarn ("no linearization type for" <+> c <> ", inserting default {s : Str}")
_ -> do checkWarn ("function" <+> c <+> "is not in abstract")
Ok (_,AbsFun {}) ->
checkError ("lincat:"<+>c<+>"is a fun, not a cat")
-}
_ -> do checkWarn ("category" <+> c <+> "is not in abstract")
checkInfo :: Options -> FilePath -> SourceGrammar -> SourceModule -> Ident -> Info -> Check Info
(Just (L loct ty), Nothing) -> do
chIn loct "operation" $
checkError (pp "No definition given to the operation")
ResOverload os tysts -> chIn NoLoc "overloading" $ do
checkUniq xss = case xss of
x:y:xs
| x == y -> checkError $ "ambiguous for type" <+>
ppType (mkFunType (tail x) (head x))
compAbsTyp g t = case t of
Vr x -> maybe (checkError ("no value given to variable" <+> x)) return $ lookup x g
checkReservedId x =
when (isReservedWord x) $
checkWarn ("reserved word used as identifier:" <+> x)
--------------------------------
TypeCheck/Abstract.hs
grammar2theory :: SourceGrammar -> Theory
Bad s -> case lookupCatContext gr m f of
Ok cont -> return $ cont2val cont
_ -> Bad s
--------------------------------
TypeCheck/ConcreteNew.hs
-- Concrete.hs has all its code commented out
--------------------------------
TypeCheck/RConcrete.hs
-- seems to be used more than ConcreteNew
computeLType :: SourceGrammar -> Context -> Type -> Check Type
AdHocOverload ts -> do
over <- getOverload gr g (Just typeType) t
case over of
Just (tr,_) -> return tr
_ -> checkError ("unresolved overloading of constants" <+> ppTerm Qualified 0 t)
inferLType :: SourceGrammar -> Context -> Term -> Check (Term, Type)
Q (m,ident) | isPredef m -> termWith trm $ case typPredefined ident of
Nothing -> checkError ("unknown in Predef:" <+> ident)
Q ident -> checks [
checkError ("cannot infer type of constant" <+> ppTerm Unqualified 0 trm)
]
QC ident -> checks [
checkError ("cannot infer type of canonical constant" <+> ppTerm Unqualified 0 trm)
]
Vr ident -> termWith trm $ checkLookup ident g
AdHocOverload ts -> do
_ -> checkError ("unresolved overloading of constants" <+> ppTerm Qualified 0 trm)
App f a -> do
case fty' of
Prod bt z arg val -> do
_ -> checkError ("A function type is expected for" <+> ppTerm Unqualified 0 f <+> "instead of type" <+> ppType fty)
S f x -> do
_ -> checkError ("table lintype expected for the table in" $$ nest 2 (ppTerm Unqualified 0 trm))
P t i -> do
Nothing -> checkError ("unknown label" <+> i <+> "in" $$ nest 2 (ppTerm Unqualified 0 ty'))
_ -> checkError ("record type expected for:" <+> ppTerm Unqualified 0 t $$
" instead of the inferred:" <+> ppTerm Unqualified 0 ty')
R r -> do
checkCond ("cannot infer type of record" $$ nest 2 (ppTerm Unqualified 0 trm)) (length ts == length fsts)
T ti pts -> do -- tries to guess: good in oper type inference
[] -> checkError ("cannot infer table type of" <+> ppTerm Unqualified 0 trm)
---- hack from Rename.identRenameTerm, to live with files with naming conflicts 18/6/2007
Strs (Cn c : ts) | c == cConflict -> do
checkWarn ("unresolved constant, could be any of" <+> hcat (map (ppTerm Unqualified 0) ts))
ExtR r s -> do
case (rT', sT') of
(RecType rs, RecType ss) -> do
_ -> checkError ("records or record types expected in" <+> ppTerm Unqualified 0 trm)
_ -> checkError ("cannot infer lintype of" <+> ppTerm Unqualified 0 trm)
getOverload :: SourceGrammar -> Context -> Maybe Type -> Term -> Check (Maybe (Term,Type))
matchOverload f typs ttys = do
checkWarn $ "ignoring lock fields in resolving" <+> ppTerm Unqualified 0 ot $$
"for" $$
nest 2 (showTypes tys) $$
"using" $$
nest 2 (showTypes pre)
([],[]) -> do
checkError $ "no overload instance of" <+> ppTerm Unqualified 0 f $$
"for" $$
nest 2 stysError $$
"among" $$
nest 2 (vcat stypsError) $$
maybe empty (\x -> "with value type" <+> ppType x) mt
([],[(val,fun)]) -> do
checkWarn ("ignoring lock fields in resolving" <+> ppTerm Unqualified 0 ot)
(nps1,nps2) -> do
checkWarn $ "ambiguous overloading of" <+> ppTerm Unqualified 0 f <+>
---- "with argument types" <+> hsep (map (ppTerm Qualified 0) tys) $$
"resolved by selecting the first of the alternatives" $$
nest 2 (vcat [ppTerm Qualified 0 fun | (_,ty,fun) <- vfs1 ++ if null vfs1 then vfs2 else []])
case [(mkApp fun tts,val) | (val,fun) <- nps1 ++ nps2] of
[] -> checkError $ "no alternatives left when resolving" <+> ppTerm Unqualified 0 f
checkLType :: SourceGrammar -> Context -> Term -> Type -> Check (Term, Type)
Abs bt x c -> do
case typ of
Prod bt' z a b -> do
_ -> checkError $ "function type expected instead of" <+> ppType typ
AdHocOverload ts -> do
_ -> checkError ("unresolved overloading of constants" <+> ppTerm Qualified 0 trm)
T _ [] ->
checkError ("found empty table in type" <+> ppTerm Unqualified 0 typ)
T _ cs -> case typ of
else checkWarn ("patterns never reached:" $$
nest 2 (vcat (map (ppPatt Unqualified 0) ps)))
_ -> checkError $ "table type expected for table instead of" $$ nest 2 (ppType typ)
V arg0 vs ->
if length vs1 == length vs
then return ()
else checkError $ "wrong number of values in table" <+> ppTerm Unqualified 0 trm
R r -> case typ of --- why needed? because inference may be too difficult
RecType rr -> do
_ -> checkError ("record type expected in type checking instead of" $$ nest 2 (ppTerm Unqualified 0 typ))
ExtR r s -> case typ of
case trm' of
RecType _ -> termWith trm' $ return typeType
ExtR (Vr _) (RecType _) -> termWith trm' $ return typeType
-- ext t = t ** ...
_ -> checkError ("invalid record type extension" <+> nest 2 (ppTerm Unqualified 0 trm))
case typ2 of
RecType ss -> return $ map fst ss
_ -> checkError ("cannot get labels from" $$ nest 2 (ppTerm Unqualified 0 typ2))
_ -> checkError ("record extension not meaningful for" <+> ppTerm Unqualified 0 typ)
S tab arg -> checks [ do
_ -> checkError ("table type expected for applied table instead of" <+> ppType ty')
_ -> do
(trm',ty') <- inferLType gr g trm
termWith trm' $ checkEqLType gr g typ ty' trm'
checkM rms (l,ty) = case lookup l rms of
_ -> checkError $
if isLockLabel l
then let cat = drop 5 (showIdent (label2ident l))
in ppTerm Unqualified 0 (R rms) <+> "is not in the lincat of" <+> cat <>
"; try wrapping it with lin" <+> cat
else "cannot find value for label" <+> l <+> "in" <+> ppTerm Unqualified 0 (R rms)
checkEqLType :: SourceGrammar -> Context -> Type -> Type -> Term -> Check Type
False -> checkError $ s <+> "type of" <+> ppTerm Unqualified 0 trm $$
"expected:" <+> ppTerm Qualified 0 t $$ -- ppqType t u $$
"inferred:" <+> ppTerm Qualified 0 u -- ppqType u t
checkIfEqLType :: SourceGrammar -> Context -> Type -> Type -> Term -> Check (Bool,Type,Type,String)
Ok lo -> do
checkWarn $ "missing lock field" <+> fsep lo
missingLock g t u = case (t,u) of
_:_ -> Bad $ render ("missing record fields:" <+> fsep (punctuate ',' (others)))
pattContext :: SourceGrammar -> Context -> Type -> Patt -> Check Context
checkCond ("wrong number of arguments for constructor in" <+> ppPatt Unqualified 0 p)
(length cont == length ps)
PR r -> do
_ -> checkError ("record type expected for pattern instead of" <+> ppTerm Unqualified 0 typ')
PAlt p' q -> do
g1 <- pattContext env g typ p'
g2 <- pattContext env g typ q
let pts = nub ([x | pt@(_,x,_) <- g1, notElem pt g2] ++ [x | pt@(_,x,_) <- g2, notElem pt g1])
checkCond
("incompatible bindings of" <+>
fsep pts <+>
"in pattern alterantives" <+> ppPatt Unqualified 0 p) (null pts)
return g1 -- must be g1 == g2
noBind typ p' = do
co <- pattContext env g typ p'
if not (null co)
then checkWarn ("no variable bound inside pattern" <+> ppPatt Unqualified 0 p)
>> return []
else return []
checkLookup :: Ident -> Context -> Check Type -- used for looking up Vr x type in context
[] -> checkError ("unknown variable" <+> x)
-------------------------------
Grammar/Lookup.hs
lookupIdent :: ErrorMonad m => Ident -> BinTree Ident b -> m b
Bad _ -> raise ("unknown identifier" +++ showIdent c)
lookupResDefLoc
_ -> raise $ render (c <+> "is not defined in resource" <+> m)
lookupResType :: ErrorMonad m => Grammar -> QIdent -> m Type
_ -> raise $ render (c <+> "has no type defined in resource" <+> m)
lookupOverloadTypes :: ErrorMonad m => Grammar -> QIdent -> m [(Term,Type)]
_ -> raise $ render (c <+> "has no types defined in resource" <+> m)
lookupOverload :: ErrorMonad m => Grammar -> QIdent -> m [([Type],(Type,Term))]
_ -> raise $ render (c <+> "is not an overloaded operation")
lookupParamValues :: ErrorMonad m => Grammar -> QIdent -> m [Term]
case info of
ResParam _ (Just pvs) -> return pvs
_ -> raise $ render (ppQIdent Qualified c <+> "has no parameter values defined")
allParamValues :: ErrorMonad m => Grammar -> Type -> m [Term]
_ -> raise (render ("cannot find parameter values for" <+> ptyp))
lookupFunType :: ErrorMonad m => Grammar -> ModuleName -> Ident -> m Type
_ -> raise (render ("cannot find type of" <+> c))
lookupCatContext :: ErrorMonad m => Grammar -> ModuleName -> Ident -> m Context
_ -> raise (render ("unknown category" <+> c))
-------------------------
PatternMatch.hs
matchPattern :: ErrorMonad m => [(Patt,rhs)] -> Term -> m (rhs, Substitution)
if not (isInConstantForm term)
then raise (render ("variables occur in" <+> pp term))
findMatch :: ErrorMonad m => [([Patt],rhs)] -> [Term] -> m (rhs, Substitution)
[] -> raise (render ("no applicable case for" <+> hsep (punctuate ',' terms)))
(patts,_):_ | length patts /= length terms ->
raise (render ("wrong number of args for patterns :" <+> hsep patts <+>
"cannot take" <+> hsep terms))
tryMatch :: (Patt, Term) -> Err [(Ident, Term)]
(PNeg p',_) -> case tryMatch (p',t) of
Bad _ -> return []
_ -> raise (render ("no match with negative pattern" <+> p))
---------------------------------------------
Compile.Optimize.hs
mkLinDefault :: SourceGrammar -> Type -> Err Term
_ -> Bad (render ("no parameter values given to type" <+> ppQIdent Qualified p))
_ -> Bad (render ("linearization type field cannot be" <+> typ))
mkLinReference :: SourceGrammar -> Type -> Err Term
[] -> Bad "no string"
---------------------------------------------
Compile.Compute.Concrete.hs
nfx env@(GE _ _ _ loc) t = do
Left i -> fail ("variable #"++show i++" is out of scope")
var :: CompleteEnv -> Ident -> Err OpenValue
var env x = maybe unbound pick' (elemIndex x (local env))
where
unbound = fail ("Unknown variable: "++showIdent x)
pick' i = return $ \ vs -> maybe (err i vs) ok (pick i vs)
err i vs = bug $ "Stack problem: "++showIdent x++": "
++unwords (map showIdent (local env))
++" => "++show (i,length vs)
resource env (m,c) =
where e = fail $ "Not found: "++render m++"."++showIdent c
extR t vv =
(VRecType rs1, VRecType rs2) ->
case intersect (map fst rs1) (map fst rs2) of
[] -> VRecType (rs1 ++ rs2)
ls -> error $ "clash"<+>show ls
(v1,v2) -> error $ "not records" $$ show v1 $$ show v2
where
error explain = ppbug $ "The term" <+> t
<+> "is not reducible" $$ explain
glue env (v1,v2) = glu v1 v2
ppL loc (hang "unsupported token gluing:" 4
(Glue (vt v1) (vt v2)))
strsFromValue :: Value -> Err [Str]
_ -> fail ("cannot get Str from value " ++ show t)
match loc cs v =
case value2term loc [] v of
Left i -> bad ("variable #"++show i++" is out of scope")
Right t -> err bad return (matchPattern cs t)
where
bad = fail . ("In pattern matching: "++)
inlinePattMacro p =
VPatt p' -> inlinePattMacro p'
_ -> ppbug $ hang "Expected pattern macro:" 4
linPattVars p =
if null dups
then return pvs
else fail.render $ hang "Pattern is not linear:" 4 (ppPatt Unqualified 0 p)
---------------------------------------------
Compile.Compute.Abstract.hs
---------------------------------------------
PGF.Linearize.hs
bracketedLinearize :: PGF -> Language -> Tree -> [BracketedString]
cnc = lookMap (error "no lang") lang (concretes pgf)
---------------------------------------------
PGF.TypeCheck.hs
ppTcError :: TcError -> Doc
ppTcError (UnknownCat cat) = text "Category" <+> ppCId cat <+> text "is not in scope"
ppTcError (UnknownFun fun) = text "Function" <+> ppCId fun <+> text "is not in scope"
ppTcError (WrongCatArgs xs ty cat m n) = text "Category" <+> ppCId cat <+> text "should have" <+> int m <+> text "argument(s), but has been given" <+> int n $$
text "In the type:" <+> ppType 0 xs ty
ppTcError (TypeMismatch xs e ty1 ty2) = text "Couldn't match expected type" <+> ppType 0 xs ty1 $$
text " against inferred type" <+> ppType 0 xs ty2 $$
text "In the expression:" <+> ppExpr 0 xs e
ppTcError (NotFunType xs e ty) = text "A function type is expected for the expression" <+> ppExpr 0 xs e <+> text "instead of type" <+> ppType 0 xs ty
ppTcError (CannotInferType xs e) = text "Cannot infer the type of expression" <+> ppExpr 0 xs e
ppTcError (UnresolvedMetaVars xs e ms) = text "Meta variable(s)" <+> fsep (List.map ppMeta ms) <+> text "should be resolved" $$
text "in the expression:" <+> ppExpr 0 xs e
ppTcError (UnexpectedImplArg xs e) = braces (ppExpr 0 xs e) <+> text "is implicit argument but not implicit argument is expected here"
ppTcError (UnsolvableGoal xs metaid ty)= text "The goal:" <+> ppMeta metaid <+> colon <+> ppType 0 xs ty $$
text "cannot be solved"

View File

@@ -2707,3 +2707,43 @@ Book{GoldbergRubin95,
}
@InProceedings{bringert-angelov-ranta:2009:EACL-DEMOS,
author = {Bringert, Bj\"{o}rn and Angelov, Krasimir and Ranta, Aarne},
title = {Grammatical Framework Web Service},
booktitle = {Proceedings of the Demonstrations Session at EACL 2009},
month = {April},
year = 2009,
address = {Athens, Greece},
publisher = {Association for Computational Linguistics},
pages = {9--12},
url = {http://www.aclweb.org/anthology-new/E09-2003},
annote = "An overview of how to build web services on top of PGF using the Google Web Toolkit."
}
@InProceedings{ranta-angelov-bringert:2009:EACL-DEMOS,
author = {Ranta, Aarne and Angelov, Krasimir and Bringert, Bj\"{o}rn},
title = {Grammar Development in {GF}},
booktitle = {Proceedings of the Demonstrations Session at EACL 2009},
month = {April},
year = 2009,
address = {Athens, Greece},
publisher = {Association for Computational Linguistics},
pages = {57--60},
url = {http://www.aclweb.org/anthology/E09-2015},
annote = "An overview of GF from the grammarian's point of view."
}
@InProceedings{ranta-angelov-hallgren:2010:Demos,
author = {Ranta, Aarne and Angelov, Krasimir and Hallgren, Thomas},
title = {Tools for Multilingual Grammar-Based Translation on the Web},
booktitle = {Proceedings of the ACL 2010 System Demonstrations},
month = {July},
year = 2010,
address = {Uppsala, Sweden},
publisher = {Association for Computational Linguistics},
pages = {66--71},
url = {http://www.aclweb.org/anthology/P10-4012},
annote = "An overview of GF for developers and users of translation systems."
}

Some files were not shown because too many files have changed in this diff Show More