iantayler / ming Goto Github PK
View Code? Open in Web Editor NEWA small module for working with Stabler's Minimalist Grammars in Perl6.
License: Artistic License 2.0
A small module for working with Stabler's Minimalist Grammars in Perl6.
License: Artistic License 2.0
A grammar like this
START=V
juan :: D
come :: =D =D V
pan :: D
works fine. The parser recognises "juan come pan" and correctly determines things like "come come pan" are not in the language.
On the other hand
START=V
juan :: D
come :: =D =D V
pan :: D
mucho :: =D D
not only fails to recognise "juan come mucho pan" as a string in the language, but also fails to recognise "juan come pan". Adding more lexical items can't un-add elements to the language, so this is a weird type of error.
Both are mentioned in Torr and Stabler (2016) but were actually some of the first extensions mentioned by Stabler in his early work on MGs.
Both are salient. Covert movement was an important part of Chomsky's (1995) model, and head movement is ubiquitous. While Chomsky assumed head movement happened at PF and could be ignored by syntacticians, what happens at PF crucially cannot be ignored by anyone implementing a parser.
This issue is best explained by example (partly because I don't know what's the problem behind the scenes: only that certain grammars I've experimented with don't work). The following grammars don't work for the issues mentioned
START=C
(empty) :: =V C
imasentence :: V
comio :: =D =D V
juan :: D
This one recognises juan comio juan properly, but it doesn't recognise imasentence. The same grammar without the lexical item comio does recognise imasentence.
START=C
(empty) :: =V C
imasentence :: C # Pay attention to the difference here.
hay :: =D V
juan :: D
This one recognises hay juan but not imasentence, even though imasentence is directly specified as a word-sentence (i.e. its feature specification includes only the start category).
START=C
(empty) :: =V C
imasentence :: C
hay :: =D V
juan :: D
comio :: =D =D V
In this last one nothing works. Not imasentence, not hay juan and not juan comio juan. This can be reproduced rather minimally as
START=V
comio :: =D =D V
hay :: =D V
juan :: D
Which fails to recognise any of the strings in the language.
It's likely that the issue is closely related (or just essentially the same issue) as #1.
The problem only appears when there's alternatives with different feature-specifications. There is no such problem if in the last example we change "hay :: =D V" for "escupe :: =D =D V". So it's possible something is going wrong with Node.children_with_property() or around that part of the code when it decides whether or not it should scan() (it seems to be getting false negatives there). In some cases, the parser favours the deeper alternative (i.e. not recognising word-sentences while properly recognising intransitive sentences), in some other cases, both options fail.
Let's just hope it isn't an asynchrony problem.
The first step in building the parser will be to admit complement directionality.
Its behaviour is pretty erratic. For example, it recognises string where the words aren't even in the lexicon, but seems to fail to recognise all actual sentences in languages.
There is very little difference in code between the parallel and the procedural parser, so the problem can only be in about 20 lines of wrapper code where the parallel parser runs all derivations in @!devq
while the procedural one pops a derivation and runs it.
I should add an optional line in grammar's headers to specify the type of the grammar. Say TYPE=EDMG
. The default should be TYPE=MG
for backwards compatibility.
I will probably have to write a separate grammar and converter actions for EDMGs and have grammar_from_text do the following:
This should all be done in a way that can be easily extended if I were to one day add another extension/variation of minimalist grammars to the module.
I should implement MinG::EDMG::Grammar is MinG::Grammar
, for which I have to implement MinG::EDMG::LItem is MinG::LItem
and MinG::EDMG::Feature is MinG::Feature
.
This will add no functionality by itself, but it is the necessary base.
In particular, I'm talking about the type of adjunction mentioned by Torr and Stabler (2016). This is important to note because several types of adjunction have been proposed in the MG literature.
I should add an example grammar as a file in resources/ so that users have an example from which to build their knowledge of MGs in general and MinG in particular.
Tests are failing with Travis CI.
Make a script to read grammars from a file (or from the resources, like issue #5 ) and parse sentences given by the user.
I should implement a more flexible feature_from_string function that can recognise EDMG features. It's probably a good idea to make it a different function from the one in MinG.pm6, to ensure we're not getting any EDMG features when handling MinG grammars (instead, proper errors should appear).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.