lumen.LexRules.xmi :
<?xml version="1.0" encoding="ASCII"?>
<relexid:LexRules xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:relexid="http://relexid/1.0"
xsi:schemaLocation="http://relexid/1.0 relexid.ecore">
<rules>
<replacements xsi:type="relexid:PronounReplacement"
partOfSpeech="pronoun" />
<replacements xsi:type="relexid:ResourceReplacement"
partOfSpeech="verb" captureGroup="2">
<replacements xsi:type="relexid:PronounReplacement"
partOfSpeech="pronoun" person="second" case="object" />
</replacements>
<matchers xsi:type="relexid:LiteralMatcher">
<literals>aku</literals>
</matchers>
<matchers xsi:type="relexid:ResourceMatcher" resource="dbpedia:Love" />
<matchers xsi:type="relexid:LiteralMatcher">
<literals>kamu</literals>
</matchers>
</rules>
<rules>
<replacements xsi:type="relexid:PronounReplacement"
partOfSpeech="pronoun" />
<replacements xsi:type="relexid:ResourceReplacement"
partOfSpeech="verb" captureGroup="2">
<replacements xsi:type="relexid:ResourceReplacement"
partOfSpeech="noun" captureGroup="3" />
</replacements>
<matchers xsi:type="relexid:LiteralMatcher">
<literals>aku</literals>
</matchers>
<matchers xsi:type="relexid:ResourceMatcher" resource="dbpedia:Like" />
<matchers xsi:type="relexid:ResourceMatcher" resource="dbpedia:Elephant" />
</rules>
<rules>
<replacements xsi:type="relexid:PunctuationReplacement" />
<matchers xsi:type="relexid:LiteralMatcher">
<literals>.</literals>
</matchers>
</rules>
</relexid:LexRules>
<?xml version="1.0" encoding="ASCII"?>
<relexid:RelationRules xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:relexid="http://relexid/1.0" xsi:schemaLocation="http://relexid/1.0 relexid.ecore">
<rules>
<matchers xsi:type="relexid:TypedPartMatcher" partOfSpeech="pronoun" />
<matchers xsi:type="relexid:TypedPartMatcher" partOfSpeech="verb">
<matchers xsi:type="relexid:TypedPartMatcher" partOfSpeech="pronoun" />
</matchers>
<relationDefs xsi:type="relexid:SubjectRelationDef">
<verb>2</verb>
<subject>1</subject>
</relationDefs>
<relationDefs xsi:type="relexid:ObjectRelationDef">
<verb>2</verb>
<object>2</object>
<object>1</object>
</relationDefs>
</rules>
<rules>
<matchers xsi:type="relexid:TypedPartMatcher" partOfSpeech="pronoun" />
<matchers xsi:type="relexid:TypedPartMatcher" partOfSpeech="verb">
<matchers xsi:type="relexid:TypedPartMatcher" partOfSpeech="noun" />
</matchers>
<relationDefs xsi:type="relexid:SubjectRelationDef">
<verb>2</verb>
<subject>1</subject>
</relationDefs>
<relationDefs xsi:type="relexid:ObjectRelationDef">
<verb>2</verb>
<object>2</object>
<object>1</object>
</relationDefs>
</rules>
</relexid:RelationRules>
Kayanya lebih nyaman andai bisa menggunakan textual DSL yang ringkas dan praktis diedit, misalnya seperti yang digunakan oleh Drools:
Possible sich diimplementasikan menggunakan Eclipse EMF Xtext. Feasible atau tidaknya belum tahu. Tapi ini cuma sekedar curhat aja sich. Tanpa DSL pun in syaa Allah baik-baik saja. Semoga ga butuh sampai ribuan rules, he..he... kan targetnya cuma kemampuan linguistik anak TK, atau bahkan preschool :)
Tidak ada komentar:
Posting Komentar