Talk:Nepali and Hindi/Verbs

From Apertium
Jump to navigation Jump to search

Rules

This file contains information on how to use the rules defined in the rules page here. This might be helpful for developing any rules in apertium. Since it contains my continuous effort of about 12 months to prepare the rule (for Nepali Wikipedia Translator )

Example:[edit]

Lets say that all the apples and Bananas need to be changed with Fruits.

Text.

All apples are good and Bananas are good for health. 

Required text after conversion:

All fruits are good and fruits are good for health.

We can have nouns in nounlist.txt

apple|fruit
banana.

So here :

(HI_noun)+ will be Apple
(NE_noun)+ will be fruit
(HI_noun)+ will be Banana
(NE_noun)+ will be fruit

The rule file will contain a rule :

(HI_noun)+s|(NE_noun)+s

Now the application will search for all the nouns with s in it.

apple and banana

add s in it

apples
bananas

replace apples with fruits

fruits

replace bananas with fruits

fruits

the result will be

All fruits are good and fruits are good for health.

Benefit[edit]

You can add a single rule: Nouns have 's' in it. You can update the Nouns in the nounlist.txt and you don't have to worry about the rules every time. The rules will be used automatically for all the nouns that are catagorised as Nouns.

Hence Nouns will be treated as nouns to make them plural (adding s) Similarly other parts of speech can have their own rules. Its likely that the list of nouns can increase, because there are more than apple and banana as nouns. Lets say papaya. In the future when you add papaya, you will not have to worry about pluralizing into papayas because the rule has already been created for papayas as (HI_noun)+s will be papayas as long as you categorize papaya as a noun.


This file was originally used by Nepali Wikipedia Translator application to generate the rules in runtime.

See also[edit]

[1]

RajeshPandey 12:10, 27 August 2011 (UTC)