Here are some examples:. The condition is usually given in terms of m, e. Elaborate conditions like this are required only rarely. In a set of rules written beneath each other, only one is obeyed, and this will be the one with the longest matching S1 for the given word. For example, with. In the rules below, examples of their application, successful or otherwise, are given on the right in lower case. The algorithm now follows:.
The rule to map to a single letter causes the removal of one of the double letter pair. This E may be removed in step 4. Step 1 deals with plurals and past participles. The subsequent steps are much more straightforward. The test for the string S1 can be made fast by doing a program switch on the penultimate letter of the word being tested. Martin Porter has endorsed several modifications to the Porter algorithm since writing his original paper, and those extensions are included in the implementations on his website.
Additionally, others have proposed further improvements to the algorithm, including NLTK contributors. Note that Martin Porter has deprecated this version of the algorithm. C CVCV V VCVC C VCVC The condition is usually given in terms of m, e. Elaborate conditions like this are required only rarely. In a set of rules written beneath each other, only one is obeyed, and this will be the one with the longest matching S1 for the given word.
0コメント