John J. Camilleri
3e2673de3b
Use modify instead of insert: results mildly better but not significantly
2021-03-16 16:45:57 +01:00
John J. Camilleri
6c6a201d96
Introduce state with Map for caching compilation, but results are worse
2021-03-12 13:39:56 +01:00
John J. Camilleri
126b61ea03
Merge branch 'master' into lpgf
2021-03-08 13:52:34 +01:00
John J. Camilleri
fd07946a50
Remove commented line
2021-03-08 10:42:16 +01:00
John J. Camilleri
785d6069e2
Fix lin2string and pass all unittests and Phrasebook
2021-03-08 09:53:10 +01:00
John J. Camilleri
0f4b349b0b
Remove old commented code
2021-03-05 16:51:59 +01:00
John J. Camilleri
dbf369aae5
Make removal of record fields recursive. Latest results with Phrasebook:
...
Bul ✓
Cat ✗
Chi ✓
Dan ✓
Dut ✓
Eng ✓
Est ✓
Fin ✓
Fre ✗
Ger ✓
Hin ✓
Ita ✗
Jpn ✓
Lav ✓
Nor ✓
Pol ✓
Ron ✓
Snd ✗
Spa ✓
Swe ✓
Tha ✓
Urd ✓
Passed 18 | Failed 4 | Total 22
2021-03-05 16:48:05 +01:00
John J. Camilleri
0d4659fe8c
Add workaround for missing param defs. Add links to gf-core issues in workaround comments.
2021-03-05 13:23:00 +01:00
John J. Camilleri
575a746a3e
Add LPGF function for catching errors. Manual fixes to Phrasebook treebank.
2021-03-05 12:05:25 +01:00
John J. Camilleri
70581c2d8c
Improve base case in table handling, cleanup. Add run-phrasebook script, current output:
...
Bul ✗
Cat ✗
Chi ✓
Dan ✓
Dut ✓
Eng ✓
Est ✓
Fin ✗
Fre ✗
Ger ✓
Hin ✓
Ita ✗
Jpn ✓
Lav ✓
Nor ✓
Pol ✓
Ron ✓
Snd ✗
Spa ✗
Swe ✓
Tha ✓
Urd ✓
Passed 15 | Failed 7 | Total 22
2021-03-04 17:09:35 +01:00
John J. Camilleri
bca1e2286d
New handling of tables, works for all tests but Phrasebook still fails
2021-03-04 16:42:56 +01:00
John J. Camilleri
f5886bf447
Add more complex param/table unit tests and pass them. Still fails on Phrasebook though.
2021-03-04 12:37:12 +01:00
John J. Camilleri
30b016032d
Also store Pre prefixes in token map. Introduce IntMapBuilder data structure.
...
Storing of prefixes uses show/read, which isn't a great solution but avoids having yet another token map.
2021-03-04 09:58:17 +01:00
John J. Camilleri
4082c006c3
Extract token strings and put them in map which linfuns refer to by index, to reduce LPGF sizes.
2021-03-04 00:16:12 +01:00
John J. Camilleri
adc162b374
Pass all unit tests and Foods again, with new strategy. Cleanup.
2021-03-03 15:21:32 +01:00
John J. Camilleri
3beed2c49e
Replace list comprehension lookups with maps. Halfway through transitioning to new strategy for tables/params, see testsuite/lpgf/README.md.
2021-03-03 13:26:03 +01:00
John J. Camilleri
997d7c1694
Use ErrorMonad instead of IOE
...
It probably ends up being the same thing, but the code is a little cleaner for it.
2021-03-03 09:36:48 +01:00
John J. Camilleri
4c09e4a340
Remove LF prefix from constructors. Pass all unit tests and Foods again, but improvements/cleanup still necessary.
2021-03-03 09:19:52 +01:00
John J. Camilleri
33e0e98aec
Add 1-tree treebank for Phrasebook in a few languages
2021-02-28 00:34:46 +01:00
John J. Camilleri
83bc3c9c6e
More work on params: pass all tests except params1 (!)
2021-02-27 23:13:02 +01:00
John J. Camilleri
f42b5ec9ef
More work on params, but Foods fails now
2021-02-26 20:25:05 +01:00
John J. Camilleri
4771d9c356
WIP params
2021-02-26 17:18:21 +01:00
krangelov
ba3e09cc38
Merge branch 'master' of https://github.com/GrammaticalFramework/gf-core
2021-02-26 14:59:18 +01:00
krangelov
8fbfc0b4a9
bracketedLinearize now reports the binding spots just like the Haskell binding
2021-02-26 14:58:31 +01:00
John J. Camilleri
8324ad8801
Add pretty-printing of LPGF grammars, to help debugging
2021-02-26 10:13:33 +01:00
John J. Camilleri
b4a393ac09
Pass missing unit test
2021-02-21 14:22:46 +01:00
John J. Camilleri
5ad5789b31
Filter out record fields which don't exist in lintype
...
This is to work around an inconsistency in the canonical representation
2021-02-19 15:19:40 +01:00
John J. Camilleri
9f3f4139b1
Grammar and languages to run in testsuite can be specified by command line options, see README
2021-02-19 11:14:55 +01:00
John J. Camilleri
023b50557e
Write LPGF dump to file when DEBUG is set, rather than console
2021-02-19 09:31:26 +01:00
John J. Camilleri
625386a14f
Force evaluation in benchmark linearisation
...
BangPatterns only does WHNF which is not sufficient, previous benchmark results are thus wrong
2021-02-18 21:01:30 +01:00
John J. Camilleri
e6079523f1
Remove ParamAliasDefs by inlining their definitions
2021-02-18 14:45:10 +01:00
John J. Camilleri
866a2101e1
When projecting a non-existent field, return Prelude.False
...
This seems to be GF's own behaviour, as exhibited by the canonical version of PhrasebookTha:
NNumeral Numeral_0 = {s = Numeral_0.s; hasC = <>.hasC};
2021-02-18 14:42:39 +01:00
John J. Camilleri
d8557e8433
Enable debug output to files with envvar DEBUG=1
2021-02-18 14:40:03 +01:00
John J. Camilleri
d3988f93d5
writePGF et al. functions return path[s] of written files
2021-02-17 10:03:52 +01:00
John J. Camilleri
236dbdbba3
Minor tidying
2021-02-17 00:15:44 +01:00
John J. Camilleri
768c3d9b2d
Include return types for params, records, pre
2021-02-17 00:04:37 +01:00
John J. Camilleri
29114ce606
Improve binary format, reducing Foods.lpgf from 300 to 73KB (4x smaller!)
2021-02-16 23:30:21 +01:00
John J. Camilleri
5be21dba1c
Add and pass FoodsJpn
2021-02-16 22:49:37 +01:00
John J. Camilleri
312cfeb69d
Add Afr, Amh, Cat, Cze, Dut, Ger foods grammars to testsuite
2021-02-16 22:33:26 +01:00
John J. Camilleri
2d03b9ee0c
Finish type passing in val2lin, generalise projection case and pass FoodsFre testsuite.
2021-02-16 21:07:24 +01:00
John J. Camilleri
4c06c3f825
Add case for when pre is not followed by anything
2021-02-16 21:01:01 +01:00
John J. Camilleri
7227ede24b
WIP return type from val2lin for use in projection case
2021-02-16 17:18:01 +01:00
John J. Camilleri
398b294734
Use Data.Text instead of String. Rename Abstr to Abstract, Concr to Concrete.
2021-02-16 16:04:40 +01:00
John J. Camilleri
d394cacddf
Add support for CAPIT and ALL_CAPIT
2021-02-16 15:17:54 +01:00
John J. Camilleri
21f14c2aa1
Add support for SOFT_SPACE
2021-02-16 14:57:33 +01:00
John J. Camilleri
23e49cddb7
Add support for SOFT_BIND (which PGF runtime doesn't support)
2021-02-16 14:51:29 +01:00
John J. Camilleri
4d1217b06d
Add support for pre
2021-02-15 21:57:05 +01:00
John J. Camilleri
109822675b
Pass test with FoodsFin, by forcibly resorting record fields to make s first
2021-02-15 00:43:53 +01:00
John J. Camilleri
d563abb928
Minors
2021-02-13 00:59:15 +01:00
John J. Camilleri
98f6136ebd
Add support for BIND
2021-02-13 00:14:35 +01:00