Skip to content

Commit 1555431

Browse files
authored
Merge branch 'GrammaticalFramework:master' into new-ghc
2 parents 3a1782a + 981d6b9 commit 1555431

File tree

6 files changed

+35
-21
lines changed

6 files changed

+35
-21
lines changed

.github/workflows/build-python-package.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v1
2020

21-
- uses: actions/setup-python@v1
21+
- uses: actions/setup-python@v5
2222
name: Install Python
2323
with:
2424
python-version: '3.x'
@@ -31,6 +31,7 @@ jobs:
3131
if: startsWith(matrix.os, 'macos')
3232
run: |
3333
brew install automake
34+
brew install libtool
3435
3536
- name: Build wheels on Linux
3637
if: startsWith(matrix.os, 'macos') != true
@@ -42,12 +43,13 @@ jobs:
4243
- name: Build wheels on OSX
4344
if: startsWith(matrix.os, 'macos')
4445
env:
45-
CIBW_BEFORE_BUILD: cd src/runtime/c && glibtoolize && autoreconf -i && ./configure && make && make install
46+
CIBW_BEFORE_BUILD: cd src/runtime/c && glibtoolize && autoreconf -i && ./configure && make && sudo make install
4647
run: |
4748
python -m cibuildwheel src/runtime/python --output-dir wheelhouse
4849
49-
- uses: actions/upload-artifact@v2
50+
- uses: actions/upload-artifact@v4
5051
with:
52+
name: wheel-${{ matrix.os }}
5153
path: ./wheelhouse
5254

5355
build_sdist:
@@ -64,8 +66,9 @@ jobs:
6466
- name: Build sdist
6567
run: cd src/runtime/python && python setup.py sdist
6668

67-
- uses: actions/upload-artifact@v2
69+
- uses: actions/upload-artifact@v4
6870
with:
71+
name: wheel-source
6972
path: ./src/runtime/python/dist/*.tar.gz
7073

7174
upload_pypi:
@@ -78,16 +81,17 @@ jobs:
7881
- uses: actions/checkout@v2
7982

8083
- name: Set up Python
81-
uses: actions/setup-python@v2
84+
uses: actions/setup-python@v5
8285
with:
8386
python-version: '3.x'
8487

8588
- name: Install twine
8689
run: pip install twine
8790

88-
- uses: actions/download-artifact@v2
91+
- uses: actions/download-artifact@v4.1.7
8992
with:
90-
name: artifact
93+
pattern: wheel-*
94+
merge-multiple: true
9195
path: ./dist
9296

9397
- name: Publish

doc/tutorial/gf-tutorial.t2t

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,6 +1739,13 @@ A new module can **extend** an old one:
17391739
Pizza : Kind ;
17401740
}
17411741
```
1742+
Note that the extended grammar doesn't inherit the start
1743+
category from the grammar it extends, so if you want to
1744+
generate sentences with this grammar, you'll have to either
1745+
add a startcat (e.g. ``flags startcat = Question ;``),
1746+
or in the GF shell, specify the category to ``generate_random`` or ``geneate_trees``
1747+
(e.g. ``gr -cat=Comment`` or ``gt -cat=Question``).
1748+
17421749
Parallel to the abstract syntax, extensions can
17431750
be built for concrete syntaxes:
17441751
```

download/index-3.11.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ stack install
139139
For more info on working with the GF source code, see the
140140
[GF Developers Guide](../doc/gf-developers.html).
141141

142+
For macOS Sequoia, you need to downgrade the LLVM package, see instructions [here](https://github.com/GrammaticalFramework/gf-core/issues/172#issuecomment-2599365457).
143+
142144
## Installing the Python bindings from PyPI
143145

144146
The Python library is available on PyPI as `pgf`, so it can be installed using:

index.html

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,6 @@ <h3>Develop</h3>
8787
<h3>Contribute</h3>
8888
<ul class="mb-2">
8989
<li>
90-
<a href="https://web.libera.chat/?channels=#gf">
91-
<i class="fas fa-hashtag"></i>
92-
IRC
93-
</a>
94-
/
9590
<a href="https://discord.gg/EvfUsjzmaz">
9691
<i class="fab fa-discord"></i>
9792
Discord
@@ -232,14 +227,10 @@ <h3>Getting help</h3>
232227
</p>
233228

234229
<p>
235-
We run the IRC channel <strong><code>#gf</code></strong> on the Libera network, where you are welcome to look for help with small questions or just start a general discussion.
236-
You can <a href="https://web.libera.chat/?channels=#gf">open a web chat</a>
237-
or <a href="https://www.grammaticalframework.org/irc/?C=M;O=D">browse the channel logs</a>.
238-
</p>
239-
<p>
240-
There is also a <a href="https://discord.gg/EvfUsjzmaz">GF server on Discord</a>.
230+
We run the <a href="https://discord.gg/EvfUsjzmaz">GF server on Discord</a>, where you are welcome to look for help with small questions or just start a general discussion.
241231
</p>
242232

233+
243234
<p>
244235
For bug reports and feature requests, please create an issue in the
245236
<a href="https://github.com/GrammaticalFramework/gf-core/issues">GF Core</a> or
@@ -254,6 +245,10 @@ <h3>Getting help</h3>
254245
<div class="col-md-6">
255246
<h2>News</h2>
256247
<dl class="row">
248+
<dt class="col-sm-3 text-center text-nowrap">2025-01-18</dt>
249+
<dd class="col-sm-9">
250+
<a href="//school.grammaticalframework.org/2025/">9th GF Summer School</a>, in Gothenburg, Sweden, 18 &ndash; 29 August 2025.
251+
</dd>
257252
<dt class="col-sm-3 text-center text-nowrap">2023-01-24</dt>
258253
<dd class="col-sm-9">
259254
<a href="//school.grammaticalframework.org/2023/">8th GF Summer School</a>, in Tampere, Finland, 14 &ndash; 25 August 2023.

src/runtime/haskell/PGF/TypeCheck.hs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ typeGenerators scope cat = fmap normalize (liftM2 (++) x y)
147147
where
148148
Scope gamma = scope
149149

150-
y | cat == cidInt = return [(1.0,ELit (LInt 999), TTyp [] (DTyp [] cat []))]
151-
| cat == cidFloat = return [(1.0,ELit (LFlt 3.14), TTyp [] (DTyp [] cat []))]
152-
| cat == cidString = return [(1.0,ELit (LStr "Foo"),TTyp [] (DTyp [] cat []))]
150+
y | cat == cidInt = return [(0.1, ELit (LInt n), TTyp [] (DTyp [] cat [])) | n <- ints]
151+
| cat == cidFloat = return [(0.1, ELit (LFlt d), TTyp [] (DTyp [] cat [])) | d <- floats]
152+
| cat == cidString = return [(0.1, ELit (LStr s),TTyp [] (DTyp [] cat [])) | s <- strs]
153153
| otherwise = TcM (\abstr k h ms ->
154154
case Map.lookup cat (cats abstr) of
155155
Just (_,fns,_) -> unTcM (mapM helper fns) abstr k h ms
@@ -163,6 +163,11 @@ typeGenerators scope cat = fmap normalize (liftM2 (++) x y)
163163
where
164164
s = sum [p | (p,_,_) <- gens]
165165

166+
-- random elements of predefined types: many instead of one AR 2025-01-17
167+
ints = [1, 2, 3, 14, 42, 123, 999, 2025, 1000000, 1234567890]
168+
floats = [0.0, 1.0, 3.14, 0.999, 0.5772156649, 2.71828, 6.62607015, 19.3, 0.0001, 1.60934]
169+
strs = words "A B X Y b c x y foo bar"
170+
166171
emptyMetaStore :: MetaStore s
167172
emptyMetaStore = IntMap.empty
168173

src/www/robots.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
User-agent: *
22
Disallow: /grammars
33
Disallow: /robust
4+
Disallow: /wikidata
45
Disallow: /*.pgf

0 commit comments

Comments
 (0)