Comments (5)
I found a solution:
define Etoee e -> é || _ "^" [ \0 & \k ] ; # \0: not zero kor & ként excluded
and
define HarmRuleC C -> á // BackVowel \Vowel* _ %^ [ \0 & \k ] .o. # ként
excluded
C -> é // FrontVowel \Vowel* _ %^ [ \0 & \k ] .o.
C -> a // BackVowel \Vowel* _ %^ [ 0 ] .o.
C -> e // FrontVowel \Vowel* _ %^ [ 0 ] ;
That works, because both special cases start with 'k'.
Is there no way to say:
I want to exclude case '+For' and case '+Tem' from a rule?
Original comment by [email protected]
on 4 Jan 2012 at 11:29
from foma.
A brief comment: usually, if a rule is phonologically conditioned, it's a good
idea to capture it with a rewrite rule, like you've done.
On the other hand, if you're dealing with an exception, sometimes it's easier
to mark it so in the lexicon, and have the rules bypass the exception. For
example, in this instance, you could have marked those words where e does not
alternate with é as, say E in the lexicon. That is, something like regE
instead of rege. Then the rule won't affect that word, and you can place a rule
like `E -> e` after the other rules. Note that generally, it's most convenient
to place the `E` only on the lower side (because you want the original form on
the lexical side), so the entry should read something like:
{{{
rege:regE
}}}
Minor detail, in `[ \0 & \k ]` the `\0`-part is redundant.
Original comment by [email protected]
on 4 Jan 2012 at 2:18
from foma.
The word rege is NOT an exception, but completely regular. The two endings
(+Tem and +For) are the exceptions.
#regét- Acc
#regéhez- All
# and so on...
BUT
#regekor- Tem
#regeként - For
#rege - Nom
I can not fond out, how to say in proper regular expression form:
No ending, or ending "ként" or ending "kor" does not need e->é, all
others do need.
This is ok:
define Etoee e -> é || _ "^" [ \k ] ; # \0: not zero kor & ként excluded
but all trials to expand \k to \(ként) and \(kor) like:
define Etoee e -> é || _ "^" [ \k \é \n \t | \k \o \r] ;
define Etoee e -> é || _ "^" \[ k é n t | k o r ] ;
fail, since
#apply down> rege+Noun+Acc
#reget
gets wrong
How can I say: If no ending or ending = ként or ending = kor, no e->é rule,
otherwise e->é rule?
I am worried, that \k is a bit too un-exact.
Original comment by [email protected]
on 5 Jan 2012 at 9:28
from foma.
I also tried to add +Abl, +Acc ... +Tem to each word, and then trigger to +Abl,
etc.., no success.
Lexc:
LEXICON Case
+Abl:^tUl+Abl #;
+Acc:^Gt+Acc #;
...
.foma:
define Grammar Lexicon .o.
Etoee ; #.o. Here I stop
Etoee looks:
define Etoee e -> é || .#. \"^"+ _ "^" ?* [ "+" A b l | "+" A c c | "+"
{Ade} | "+" {All} | "+" {Cau} | "+" {Dat} | "+" {Del} | "+" {Ela} | "+" {Fac} |
"+" {For} | "+" {Ill} | "+" {Ine} | "+" {Ins} | "+" {Nom} | "+" {Sub} | "+"
{Sup}| "+" {Ter} ] ?* ;
I try both A b l and {Ade} form, none works
Results:
foma[1]: down
apply down> rege+Noun+Abl
rege^tUl+Abl
apply down> rege+Noun+Acc
rege^Gt+Acc
apply down> rege+Noun+Ade
rege^nDl+Ade
apply down>
no e->é on any place :-(
foma[1]: lower-words
rege^ig+Ter
rege^Pn+Sup
rege^rF+Sub
rege^+Nom
rege^VFl+Ins
rege^bFn+Ine
rege^bF+Ill
rege^ként+For
rege^VD+Fac
rege^bUl+Ela
rege^rUl+Del
rege^nFk+Dat
rege^ért+Cau
rege^hIz+All
rege^nDl+Ade
rege^Gt+Acc
rege^tUl+Abl
Strange is, that I did the same modification on the English lexc/foma files
before:
in lexc:
LEXICON Vinf
+V+PresPart:^ing+PP #;
in foma:
define ConsonantDoubling g -> g g || .#. \"^"+ _ "^" ?* [ "+" {PP} | e d ] ?*;
...
define CleanupPP [ "+" {PP} ] -> 0;
define Grammar Lexicon .o.
ConsonantDoubling .o.
...
CleanupPP .o.
Cleanup;
regex Grammar;
That works perfectly well:
lower-words
beg
begs
begging
begged
begged
I attach both the English and the Hungarian files here.
Original comment by [email protected]
on 5 Jan 2012 at 7:56
Attachments:
from foma.
I have found a quite well-looking solution. I modified step by step the English
file, until it handled the Hungarian nouns, as it should. We can close this
issue.
Original comment by [email protected]
on 6 Jan 2012 at 8:41
Attachments:
from foma.
Related Issues (20)
- Left repalce epenthesis rule don't work HOT 1
- For compilation such quiet mode would be good, that printed only errors
- How to represent FST network visually HOT 3
- memory hog in apply.c xxstrdup, string never freed, if used in flookup.
- Context restriction doesn't work with term negation HOT 2
- BOM symbol is not ignored
- Various code validity issues
- fsm_read_prolog() cannot handle quotation marks in symbols HOT 1
- view net blows up if a symbol contains \"
- fomalib.h should be protected against double inclusion
- An FSA that behaves strange HOT 2
- Foma exits 0 - zero - on lexc syntax error
- converted xfsm to foma does not work HOT 5
- r227 build fails on wheezy, precise, saucy HOT 1
- flookup throws error HOT 1
- Looking for advice on unsuccesful compilation on out of memory error HOT 4
- Rule representation HOT 3
- Some help applying rules HOT 3
- _eq function with flag diacritics didn't work
- reduplication restriction
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from foma.