forest_N = (mkNplus (mkN "лес" masculine inanimate (ZC 1 No C ZC1))) ** {sloc="лесу"} ;--
---
You received this message because you are subscribed to the Google Groups "Grammatical Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gf-dev+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gf-dev/94fcaf3a-5f51-431a-b9d5-4b72046ab0fbo%40googlegroups.com.
| mkN : NounForms -> N |
To view this discussion on the web visit https://groups.google.com/d/msgid/gf-dev/CAMymDzoJ1i5cPVNfHy17xV0skyBCq3OcONqDZWb5G0O7R16yNg%40mail.gmail.com.
Hi John,Regarding workarounds: Yes, I guess those will work, thanks. The problem with workarounds for feather_N is that it makes lexicon description more verbose for no obvious reason.
As for problems with the order, they are not about changing 2-3 cases afterwards as in case of forest_N (it simply works as expected), but to describe the worst case: All cases, using this overload:= \nf -> lin N nf ;
mkN : NounForms -> N This one seems to work only when the order is exactly the same as in NounForms. I am not quite sure why there is such a limitation. I suspect type checking oddities as {pgen="YYY";pnom="XXX"} and {pnom="XXX";pgen="YYY"} should be of the same type.
To view this discussion on the web visit https://groups.google.com/d/msgid/gf-dev/CAGMtdKchwKM29ynxQ%2BEoWmDCeYuWxnVjsfsxZuzGNaaWeJmC4Q%40mail.gmail.com.
| mkN : NounForms -> N |
NounForms : Type = {
snom, sgen, sdat, sacc, sins, sprep, sloc, sptv, svoc,
pnom, pgen, pdat, pacc, pins, pprep : Str ;
g : Gender ;
a : Animacy
} ;mkN = overload {
mkN : (nom : Str) -> N
= \nom -> lin N (guessNounForms nom) ;
mkN : Str -> Gender -> Animacy -> N
= \nom, g, a -> lin N (guessLessNounForms nom g a) ;
mkN : Str -> Gender -> Animacy -> ZIndex -> N
= \word, g, a, z -> lin N (noMinorCases (makeNoun word g a z)) ;
mkN : Str -> Gender -> Animacy -> Str -> N
= \word, g, a, zi -> lin N (noMinorCases (makeNoun word g a (parseIndex zi))) ;
mkN : NounForms -> N = \nf -> lin N nf ;
} ;
lin
animal_N = mkN {
snom="с"; sgen="с"; sdat="с"; sacc="с"; sins="с"; sprep="с"; sloc="с"; sptv="с"; svoc="с";
pnom="с"; pgen="с"; pdat="с"; pacc="с"; pins="с"; pprep="с";
g=Masc;
a=Inanimate
} ;
On Mon, 22 Jun 2020 at 06:39, Roman Suzi <roma...@gmail.com> wrote:
--Hi!This time I have some code for the next generation Russian RGL to show: https://github.com/rnd0101/gf-rgl-russian2There is no support for anything but noun paradigms descriptions at the moment, plus it's not totally bug free, but it is based on a mainstream approach - so-called "Zalizniak algorithm" (I am using subset of Zalizniak index as it covers significant portion of Russian words. The algo itself covers 100%.) Indices can be easily found on wiktionary, individual words eg here: http://gramdict.ru/GF proved to be a good tool for the job so far except for small nuisances:1. It remains unclear to me why records depend on the order of constituents sometimes ( causing extra effort with describing "worst case" words https://github.com/rnd0101/gf-rgl-russian2/blob/master/src/russian2/ParadigmsRus.gf#L63 )2. Sometimes explicit type needs to be indicated where I'd expected it to be deduced with type system (I do not remember where it was, in the middle of some function )3. Not sure why it's not possible to take a record directly in concrete grammar, so some semi-dummy workaround with an extra function was needed like here: https://github.com/rnd0101/gf-rgl-russian2/blob/master/src/russian2/LexiconRus.gf#L60Overall, I am surprised myself how far I was able to move into this. In my opinion it's a very clear improvement over what is now in Russian RG on all fronts. I used frequencies of appearances of certain declension styles to focus on, not Swadesh list, so picking uniformly random Russian word will likely work automatically. However, most frequent Russian nouns list is not covered 100% by automatics, which IMHO is also fine as it can be in the DictRus2 and finetuned manually. (old dictrus contains so many errors, that I'd just removed it)I hope to do more. The main idea is, that paradigms should have more flexible connection with the rest. Even with Zalizniak it's clear that some Russian nouns will have declensions of adjectives (уп http://gramdict.ru/search/%D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%B2%D0%BE%D0%B4%D0%BD%D0%B0%D1%8F ) - so the lexicon description references adjective-style declension type. Same for some pronouns, etc. So at the bottom of making word forms different abstractions are used, not parts of speech. (well, they mostly follow parts of speech, but not 100%). In other words, in Russian it may also well be that declension follows different gender than the word is considered to be in, so producing forms should be somewhat disconnected anyway.Please, comment if something looks terribly wrong. (noun linearization is temporarily set to show all forms as debug). For example, I decided to include so-called minor cases explicitly instead of having special-purpose workarounds in the old RG, eg:forest_N = (mkNplus (mkN "лес" masculine inanimate (ZC 1 No C ZC1))) ** {sloc="лесу"} ;illustrates approach of having what was previously quite irregular word. While this kind of description looks complex, it's not complicated and is very straightforward from whatgives. (the ZC 1 No C ZC1 part is just an encoding of the index ( 1c(1) ) , and locative minor case also mentioned to be present in the dictionary entry.)The only ugly part is that mkNplus, which I am not sure how to omit, but maybe it's even better this way. Many words can still be guesses with just: mkN "слово" , some more with adding gender/animacy. "Worst case" can be given with a record. I have not yet encountered words, which would require it.With best regards,RomanPS. this is my personal project, not related to work
---
You received this message because you are subscribed to the Google Groups "Grammatical Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gf-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gf-dev/94fcaf3a-5f51-431a-b9d5-4b72046ab0fbo%40googlegroups.com.
--
---
You received this message because you are subscribed to the Google Groups "Grammatical Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gf-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gf-dev/CAMymDzoJ1i5cPVNfHy17xV0skyBCq3OcONqDZWb5G0O7R16yNg%40mail.gmail.com.
--
---
You received this message because you are subscribed to the Google Groups "Grammatical Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gf-...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to gf-dev+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gf-dev/26bc02f8-2f7d-4d3d-ace9-5b4af0fb8aedo%40googlegroups.com.
animal_N = mkN "пример" {
a=Inanimate;
g=Masc;
pacc="с";
pdat="с";
pgen="с";
pins="с";
pnom="с";
pprep="с" ;
sacc="с";
sdat="с";
sgen="с";
sins="с";
sloc="с";
snom="с";
sprep="с";
sptv="с";
svoc="с";
};dummyNounForms : Str -> NounForms -> NounForms = \s, nf -> guessNounForms s ;
mkN : Str -> NounForms -> N
= \s, nf -> lin N (dummyNounForms s nf) ;
-- this also does not work without order matching.
This looks definitely strange!Just a thought, could you try to annotate the nf argument like this?mkN : NounForms -> N = \nf -> lin N <nf:NounForms> ;
I made a standalone example of the problem, all in one file. https://gist.github.com/inariksit/e6e69b324f6cf2051f35cafe910ea363 That <nf:NounForms> annotation didn't help there, but maybe there are some other things in play, like my file is just a resource, no lins anywhere.
Inari
To view this discussion on the web visit https://groups.google.com/d/msgid/gf-dev/26bc02f8-2f7d-4d3d-ace9-5b4af0fb8aedo%40googlegroups.com.
(<> ** {... any order here ...})--
---
You received this message because you are subscribed to the Google Groups "Grammatical Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gf-dev+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gf-dev/5749C727-2D1B-421F-83D6-3B704AF0390D%40gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to gf-...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to gf-dev+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gf-dev/b5f4d09c-23ee-4964-8473-ac7014b12a46o%40googlegroups.com.