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
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
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 :-)
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.