Accessing more than one grammar simultaneously

9 views
Skip to first unread message

Kevin Donnelly

unread,
May 31, 2010, 3:21:36 PM5/31/10
to Constraint Grammar
Hi

I am using basic CGs to disambiguate dictionary lookups of words in
conversations. The conversations are multilingual, so in fact I need to use
multiple dictionaries, and in turn that requires the use of multiple
grammars.

What I am doing at the minute, which works pretty well, is have the script
that does the lookup also add a tag for the language to the printout, eg for
Welsh (cy):
"<mynd>"
"mynd" cy vinf :go:
When I write the rules for the different languages, I then include this tag,
so that they will act only on that language.

I'm just wondering if there is some method other than this which would be
better, but which I'm not aware of.

--
Pob hwyl / Best wishes

Kevin Donnelly

kevindonnelly.org.uk - Welsh and stuff

Kevin Brubeck Unhammer

unread,
May 31, 2010, 4:18:52 PM5/31/10
to constrain...@googlegroups.com
2010/5/31 Kevin Donnelly <ke...@dotmon.com>:

> Hi
>
> I am using basic CGs to disambiguate dictionary lookups of words in
> conversations.  The conversations are multilingual, so in fact I need to use
> multiple dictionaries, and in turn that requires the use of multiple
> grammars.
>
> What I am doing at the minute, which works pretty well, is have the script
> that does the lookup also add a tag for the language to the printout, eg for
> Welsh (cy):
> "<mynd>"
>        "mynd" cy vinf :go:
> When I write the rules for the different languages, I then include this tag,
> so that they will act only on that language.
>
> I'm just wondering if there is some method other than this which would be
> better, but which I'm not aware of.

You could run a language detector (eg.
http://software.wise-guys.nl/libtextcat/) to select which dictionary
(and which CG) will run on each sentence. Of course, then you can't
reference previously seen words/tags from language1 in a rule in
language2 (or words with intervening "foreign" words), so if that's
what you're after it won't help much…


best regards,
Kevin Brubeck Unhammer

Kevin Donnelly

unread,
May 31, 2010, 4:48:05 PM5/31/10
to constrain...@googlegroups.com
On Monday 31 May 2010 21:18, Kevin Brubeck Unhammer wrote:
> You could run a language detector (eg.
> http://software.wise-guys.nl/libtextcat/) to select which dictionary
> (and which CG) will run on each sentence.

Thanks, but apart from the additional overhead, the language can switch within
sentences. I actually know from an earlier stageof the processing what
language the word is in, but I was just wondering if there is a better way of
applying multiple grammars to the entire text at once. On reflection, I
can't actually see that there is :-)

Tino Didriksen

unread,
Jun 1, 2010, 3:58:38 AM6/1/10
to Constraint Grammar
On May 31, 9:21 pm, Kevin Donnelly <ke...@dotmon.com> wrote:
> What I am doing at the minute, which works pretty well, is have the script
> that does the lookup also add a tag for the language to the printout, eg for
>
> Welsh (cy):
> "<mynd>"
>         "mynd" cy vinf :go:
>
> When I write the rules for the different languages, I then include this tag,
> so that they will act only on that language.

Sounds like a working method.
I would suggest longer tags, such as ISO-639-3 cym with a prefix lang-
cym and/or wrapped in <lang-cym>. Anything to avoid some language tags
being misunderstood as grammatical information.

> I'm just wondering if there is some method other than this which would be
> better, but which I'm not aware of.

There is indeed nothing implemented yet which would really help with
this.
If anyone can think of a way they would like to be able to structure
their grammars and rules to make multilingual text easier to work
with, do tell so I can look at implementing a solution.

-- Tino Didriksen

Kevin Donnelly

unread,
Jun 6, 2010, 5:28:02 PM6/6/10
to constrain...@googlegroups.com
On Tuesday 01 June 2010 08:58, Tino Didriksen wrote:
> Sounds like a working method.
> I would suggest longer tags, such as ISO-639-3 cym with a prefix lang-
> cym and/or wrapped in <lang-cym>. Anything to avoid some language tags
> being misunderstood as grammatical information.

Thanks for the advice - I'll do that. In fact, it turns out that I don't need
to invoke the language tag all that often, because many of the rules quote
the lemma, which has a very small likelihood of being homonymous between
languages.

Reply all
Reply to author
Forward
0 new messages