Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some help applying rules #59

Open
GoogleCodeExporter opened this issue Mar 3, 2016 · 3 comments
Open

Some help applying rules #59

GoogleCodeExporter opened this issue Mar 3, 2016 · 3 comments

Comments

@GoogleCodeExporter
Copy link

Hi there with the change of my code I lost the ability to analyse 
reduplication, but working on that I have come up with a solution, the only 
thing is I can not find the way to apply rules to the resulting reduplicated 
root, so here we go
file: slot-36.foma
# Slot 36 > Verbalizers
  ["+VRB""@Ø36"] : 0
| ["+VRB""@nge36"] : {nge}
| ["+VRB""@tu36"] : {tu}
| ["+VRB""@ntu36"] : ["@N"{tu}]
| ["+VRB""@l36"] : l
| ["+VRB""@ye36"] : {ye}

# Slot 36 > Stem formatives
| ["+SFR""@tu36"] : {tu}
| ["+SFR""@nge36"] : {nge}
| ["+SFR""@ye36"] : {ye}
| ["+SFR""@Ø36"] : 0
;

file: onroot.foma
# OTC onomatopeic roots, Spanish translations
["@ON"{graznido, croar, cacareo}] : {kar}
| ["@ON"{chirrido, risita}] : {kid}
| ["@ON"{maullido}] : {ñaw}
| ["@ON"{rebuznar, relinchar}] : {ngay}
| ["@ON"{gorjeo, piar}] : {pish}
| ["@ON"{ronquido}] : {tral}
| ["@ON"{castañeteo de dientes, tiritar}] : {tril}
| ["@ON"{derramamiento, desbordamiento}] : {truf}
| ["@ON"{fluir líquidos, correr el agua}] : {wal}
| ["@ON"{chillido del chancho}] : {wir}
| ["@ON"{sonido de golpes}] : {tray}
;

FST Code:
# Read in slots
define SFRVRB @re"slots/28-36-Fixed-Derivational-Suffixes/slot-36.foma";
define ONROOT @re"roots/onroot.foma";   ! Onomatopoeic Roots

define TagONOff [ 0 <- "@ON" ];
define ONROOTNoTag TagONOff .o. ONROOT;
define ONROOTx2 "@ONRR"%< ONROOTNoTag %> (%< \[%<|%>]+ %> );
define REDONR _eq(ONROOTx2, %<,%>) .o. %<|%>|"@ONRR" -> 0;

define RuRROnom [[?* "@ONRR"] => _ ["+SFR""@Ø36"] ?* ];

define FORM REDONR|REDVBR SFRVRB;

Ok, I've tried adding the rule (RuRROnom) in many different places but it never 
works, at some points does nothing and at some others it blocks the results, I 
mean if I do an up karkar I get ???, while without the rule I get:
@ONRR<graznido, croar, cacareo><kar>+VRB@Ø36
@ONRR<graznido, croar, cacareo><kar>+SFR@Ø36

with the rule applying correctly it should only be this: 
@ONRR<graznido, croar, cacareo><kar>+SFR@Ø36

I hope you can give an advice, maybe it is just a simple thing, but I can not 
find it...
Thanks

Original issue reported on code.google.com by andreschandiaf on 7 Apr 2015 at 4:03

@GoogleCodeExporter
Copy link
Author

I forgot this line at the end of the FST code:
read regex FORM;

Original comment by andreschandiaf on 7 Apr 2015 at 4:55

@GoogleCodeExporter
Copy link
Author

Sorry another mistake, for this example this line:
define FORM REDONR|REDVBR SFRVRB;

should be:
define FORM REDONR SFRVRB;

Original comment by andreschandiaf on 8 Apr 2015 at 11:40

@GoogleCodeExporter
Copy link
Author

I'm thinking that it is maybe something in the notation, I mean the symbols 
that remain, I don't know if that is correct, but there is something that 
prevents me from applying the rule, maybe my idea is wrong, but this is what I 
see that should happen:
1. I take off the "@ON" tag, this is because the rules for an element with this 
tag are different from the ones for elements with the "@ONRR" tag.
2. I add the new tag "@ONRR" and the operators to reduplicate de root
3. I run the operation _eq(.... and clean out the result
4. I apply the rule to the element that has the the new tag "@ONRR"

Original comment by andreschandiaf on 8 Apr 2015 at 9:07

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant