You are here

function PorterStemmerInternalsUnitTest::testIesIed in Porter-Stemmer 6.2

Same name and namespace in other branches
  1. 7 porterstemmer.test \PorterStemmerInternalsUnitTest::testIesIed()

Test internal steps on the words "ies" and "ied".

File

./porterstemmer.test, line 714
Tests for the Porter Stemmer module. By Jennifer Hodgdon of Poplar ProductivityWare, www.poplarware.com Unit tests are based on sample words from http://snowball.tartarus.org/algorithms/english/stemmer.html which are stored in a separate file…

Class

PorterStemmerInternalsUnitTest
Unit tests for Porter Stemmer - Stemming internals.

Code

function testIesIed() {
  $r1a = 0;
  $r2a = 0;
  $r1b = 0;
  $r2b = 0;
  $worda = 'ied';
  $wordb = 'ies';
  variable_set('minimum_word_size', 2);
  porterstemmer_too_short('', TRUE);
  porterstemmer_prestemming($worda, $r1a, $r2a);
  porterstemmer_prestemming($wordb, $r1b, $r2b);

  // Test step 1a of the algorithm
  porterstemmer_step1a($worda);
  porterstemmer_step1a($wordb);
  $this
    ->assertEqual($worda, 'ie', "Step1a should be ie, was {$worda}", 'Stemmer steps');
  $this
    ->assertEqual($wordb, 'ie', "Step1a should be ie, was {$wordb}", 'Stemmer steps');
}