Some questions

27 views
Skip to first unread message

Kevin Donnelly

unread,
Mar 3, 2016, 6:00:00 AM3/3/16
to constrain...@googlegroups.com
Some questions.  Sorry if they're obvious, but I'm trying to expand my tutorial.

(1) The manual (http://beta.visl.sdu.dk/cg3/chunked/grammar.html#grammar-sections) says: "Sections can also be given a name for easier identification and anchor behavior, but that is optional."  What is the format for this name?

SECTION mysectionname; or

SECTION:mysectionname;

don't throw errors, but don't look right somewhow. :-( (2) If I create a dependency group (eg Adj+Adj+Noun) using setparent, can I refer to this particular group subsequently by name? (3) With move or setparent (http://beta.visl.sdu.dk/cg3/chunked/cgkeywords.html): MOVE WITHCHILD (*) targetset (-1* ("someword")) BEFORE (1* ("buffalo")) (-1 ("water")) ; SETPARENT targetset (-1* ("someword")) TO (1* (step) LINK 1* (candidate)) (2 SomeSet) ; contextual tests are possible.  Do these tests, as usual, relate to position as originating from the targetset, ie (-1* ("someword")) would relate to the lemma "someword" found anywhere to the left of the targetset?  In the setparent example above, the parent would end up being "candidate"?

(4) Are contextual tests possible with addcohort? http://beta.visl.sdu.dk/cg3/chunked/rules.html#addcohort suggests yes, so (using one of the examples there), if I write:

ADDCOHORT ("<wordform>" "baseform" tags) BEFORE (waffles) if (-1 ("Belgian") ; would add the cohort if the text referred to "Belgian waffles"? (5) We can put the "anywhere" asterisk before or after the locator numeral (eg 1* or *1) (http://beta.visl.sdu.dk/cg3/chunked/contexts.html#test-position), but is there a "preferred" position (as in "most people do this")? (6) Possible bug in the IDE? On the Input -> Files/Pipe tab, if you press Add Program to add a program for a pipeline, and navigate to (say) /usr/bin, no cg3 programs are listed except for

cg3-autobin.pl. The listing only seems to include those with a dot+extension (so I get a subset of the 2297 programs there).

(7) Possible bug in the IDE? How do you call up the Jump to Section dropdown? On some of my installs it is showing, and on others not, even with the same grammar file.

(8) Feature request for the IDE: Display line numbers for the grammar in the central pane? (9) Feature request for the IDE: On reopening, load the same input and grammar files as were being used previously, instead of the "demo" input and grammar? (10) Feature request for cg-conv: "Currently only meant for use in a pipe." (http://beta.visl.sdu.dk/cg3/chunked/cmdreference.html#cg-conv)  Make it useable from the command-line too, for quick-and-dirty formatting?  Something like: cg-conv "This is some text.", or: cat "This is some text." | cg-conv (perhaps with -p and -C being assumed unless otherwise informed)? Two other points that I'm just noting for the record: (a) If you're on Ubuntu 14.04 and not using Unity, you need to uninstall appmenu-qt5 to have the menu show on the IDE. (b) A pipe like:

/usr/bin/cg-conv

/usr/bin/vislcg3 -g /home/kevin/cg3/grammar/new1.cg3 didn't work in 11341, but does now in 11374, so upgrade if you need to use that.

-- 

Kevin Donnelly
kevindonnelly.org.uk
cymraeg.org.uk

Tino Didriksen

unread,
Mar 3, 2016, 11:49:09 AM3/3/16
to constrain...@googlegroups.com
Replied inline...

On 3 March 2016 at 11:54, Kevin Donnelly <ke...@dotmon.com> wrote:
(1) The manual (http://beta.visl.sdu.dk/cg3/chunked/grammar.html#grammar-sections) says: "Sections can also be given a name for easier identification and anchor behavior, but that is optional."  What is the format for this name?

SECTION mysectionname; or

SECTION:mysectionname;

don't throw errors, but don't look right somewhow. :-(

It's space for section names. I'll add an example to the manual.

 
(2) If I create a dependency group (eg Adj+Adj+Noun) using setparent, can I refer to this particular group subsequently by name?

No, dependency groups don't have names. In general, you can't refer to multiple cohorts in any way. I think only Move can do something with groups of cohorts.

 
(3) With move or setparent (http://beta.visl.sdu.dk/cg3/chunked/cgkeywords.html): MOVE WITHCHILD (*) targetset (-1* ("someword")) BEFORE (1* ("buffalo")) (-1 ("water")) ; SETPARENT targetset (-1* ("someword")) TO (1* (step) LINK 1* (candidate)) (2 SomeSet) ; contextual tests are possible.  Do these tests, as usual, relate to position as originating from the targetset, ie (-1* ("someword")) would relate to the lemma "someword" found anywhere to the left of the targetset?  In the setparent example above, the parent would end up being "candidate"?


The dependency target tests relate to the dependency target, in this case the cohorts found by (1* ("buffalo")) and (1* (step) LINK 1* (candidate)). To relate to the rule target, just put the tests before the dependency keyword (Before/After/To/From).

 

(4) Are contextual tests possible with addcohort? http://beta.visl.sdu.dk/cg3/chunked/rules.html#addcohort suggests yes, so (using one of the examples there), if I write:

ADDCOHORT ("<wordform>" "baseform" tags) BEFORE (waffles) if (-1 ("Belgian") ; would add the cohort if the text referred to "Belgian waffles"?

Yes, exactly like that.

 
(5) We can put the "anywhere" asterisk before or after the locator numeral (eg 1* or *1) (http://beta.visl.sdu.dk/cg3/chunked/contexts.html#test-position), but is there a "preferred" position (as in "most people do this")?

I write 1* and -1* because I semantically think of it as e.g. "go 1 to the left, then scan onwards from there", which is also how it is implemented.

 
(6) Possible bug in the IDE? On the Input -> Files/Pipe tab, if you press Add Program to add a program for a pipeline, and navigate to (say) /usr/bin, no cg3 programs are listed except for

cg3-autobin.pl. The listing only seems to include those with a dot+extension (so I get a subset of the 2297 programs there).


Yup, that's a bug. The search pattern is *.* - it should just be * on non-Windows. But you can just type in what you want - I didn't expect anyone to actually use those buttons on non-Windows platforms.

 

(7) Possible bug in the IDE? How do you call up the Jump to Section dropdown? On some of my installs it is showing, and on others not, even with the same grammar file.


Can you reproduce it in any consistent fashion, and if so what versions of everything?

 
(8) Feature request for the IDE: Display line numbers for the grammar in the central pane?

Gutter line numbers are on ToDo. The line number is shown in the status bar, though, which I personally have always found sufficient.

 
(9) Feature request for the IDE: On reopening, load the same input and grammar files as were being used previously, instead of the "demo" input and grammar?

Yeah, proper project handling is on ToDo...

 
(10) Feature request for cg-conv: "Currently only meant for use in a pipe." (http://beta.visl.sdu.dk/cg3/chunked/cmdreference.html#cg-conv)  Make it useable from the command-line too, for quick-and-dirty formatting?  Something like: cg-conv "This is some text.", or: cat "This is some text." | cg-conv (perhaps with -p and -C being assumed unless otherwise informed)?

It is usable for that. If you run cg-conv --help, you can see the options for which formats it can convert between.

It's just not meant for regular use - it's a workaround tool so that new people don't have to maintain their own scripts for format conversion, but eventually people will probably want more control over how the conversion is done.

 
Two other points that I'm just noting for the record: (a) If you're on Ubuntu 14.04 and not using Unity, you need to uninstall appmenu-qt5 to have the menu show on the IDE.

Curious...

 
(b) A pipe like:

/usr/bin/cg-conv

/usr/bin/vislcg3 -g /home/kevin/cg3/grammar/new1.cg3 didn't work in 11341, but does now in 11374, so upgrade if you need to use that.


What part of that didn't work? But anyway, everyone should always use latest versions.

-- Tino Didriksen 

Kevin Brubeck Unhammer

unread,
Mar 3, 2016, 3:56:18 PM3/3/16
to Kevin Donnelly, constrain...@googlegroups.com
Kevin Donnelly <ke...@dotmon.com> čálii:

> Something like: cg-conv "This is some text.", or: cat "This is some
> text." | cg-conv

echo "This is some text." | cg-conv
signature.asc

Kevin Donnelly

unread,
Mar 4, 2016, 1:45:42 PM3/4/16
to constrain...@googlegroups.com
Thanks for the replies.



On 03/03/16 16:48, Tino Didriksen wrote:
The dependency target tests relate to the dependency target, in this case the cohorts found by (1* ("buffalo")) and (1* (step) LINK 1* (candidate)). To relate to the rule target, just put the tests before the dependency keyword (Before/After/To/From).


OK.  I discovered yesterday that you can't use "if" in these conditions, even though I think you can write it (even though it's ignored) for legibility in front of other contextual tests:

move withchild (*) Subject after (1* Verb) (0 ("be")) ; throws an error if you put if before the test.



I write 1* and -1* because I semantically think of it as e.g. "go 1 to the left, then scan onwards from there", which is also how it is implemented.


OK.  Good to know.



Yup, that's a bug. The search pattern is *.* - it should just be * on non-Windows. But you can just type in what you want - I didn't expect anyone to actually use those buttons on non-Windows platforms.


New users may? 

 

(7) Possible bug in the IDE? How do you call up the Jump to Section dropdown? On some of my installs it is showing, and on others not, even with the same grammar file.


Can you reproduce it in any consistent fashion, and if so what versions of everything?


I'll investigate further.



Gutter line numbers are on ToDo. The line number is shown in the status bar, though, which I personally have always found sufficient.


Ah - hadn't noticed that.  Yes, probably sufficient.


On 03/03/16 20:56, Kevin Brubeck Unhammer wrote:
echo "This is some text." | cg-conv


Thanks! Forgot to check echo.  cat is the one for files.
Reply all
Reply to author
Forward
0 new messages