var steps=Array();
function is_vowel(_1,i){
var ch=_1.charAt(i);
if(ch=="a"||ch=="e"||ch=="i"||ch=="o"||ch=="u"){
return true;
}
if(ch!="y"||i==0){
return false;
}
return !is_vowel(_1,i-1);
}
function contains_vowel(_4){
for(var i=0;i!=_4.length;++i){
if(is_vowel(_4,i)){
return true;
}
}
return false;
}
function endswith(_6,_7){
var _8=_6.lastIndexOf(_7);
if(_8!=-1&&_8==_6.length-_7.length){
return true;
}
return false;
}
function m(_9){
var i=0;
var _b=0;
while(i!=_9.length){
if(is_vowel(_9,i)){
break;
}
++i;
}
while(i!=_9.length){
if(is_vowel(_9,i)){
++i;
}else{
++_b;
while(i!=_9.length){
if(is_vowel(_9,i++)){
break;
}
}
}
}
return _b;
}
function ends_with_double_c(_c){
if(_c.length<2){
return false;
}
return (_c.charAt(_c.length-1)==_c.charAt(_c.length-2)&&!is_vowel(_c,_c.length-1));
}
function ends_with_cvc(_d){
if(_d.length<3){
return false;
}
var ch=_d.charAt(_d.length-1);
if(ch=="w"||ch=="x"||ch=="y"){
return false;
}
if(is_vowel(_d,_d.length-1)){
return false;
}
if(!is_vowel(_d,_d.length-2)){
return false;
}
return !is_vowel(_d,_d.length-3);
}
function strip_apos(_f){
var i=_f.indexOf("'");
if(i==-1){
return _f;
}
return _f.substring(0,i);
}
function stem(_11,_12){
steps=Array();
_11=strip_apos(_11).toLowerCase();
if(_11.length<=2){
return _11;
}
if(endswith(_11,"sses")){
_11=_11.substring(0,_11.length-2);
steps[steps.length]=["1a) SSES -> SS",_11];
}else{
if(endswith(_11,"ies")){
_11=_11.substring(0,_11.length-2);
steps[steps.length]=["1a) IES -> I",_11];
}else{
if(endswith(_11,"ss")){
steps[steps.length]=["1a) SS -> SS",_11];
}else{
if(endswith(_11,"s")){
_11=_11.substring(0,_11.length-1);
steps[steps.length]=["1a) S -> ",_11];
}
}
}
}
do{
if(endswith(_11,"eed")){
if(m(_11.substring(0,_11.length-3))>0){
_11=_11.substring(0,_11.length-1);
steps[steps.length]=["1b) (m>0) EED -> EE",_11];
}
break;
}
if(_12&&endswith(_11,"eeth")){
if(m(_11.substring(0,_11.length-4))>0){
_11=_11.substring(0,_11.length-2);
steps[steps.length]=["1b) (m>0) EETH -> EE",_11];
}
break;
}
if(_12&&endswith(_11,"eest")){
if(m(_11.substring(0,_11.length-4))>0){
_11=_11.substring(0,_11.length-2);
steps[steps.length]=["1b) (m>0) EEST -> EE",_11];
}
break;
}
if(endswith(_11,"ed")){
if(contains_vowel(_11.substring(0,_11.length-2))){
_11=_11.substring(0,_11.length-2);
steps[steps.length]=["1b) (*v*) ED -> ",_11];
}else{
break;
}
}else{
if(endswith(_11,"ing")){
if(contains_vowel(_11.substring(0,_11.length-3))){
_11=_11.substring(0,_11.length-3);
steps[steps.length]=["1b) (*v*) ING -> ",_11];
}else{
break;
}
}else{
if(_12&&endswith(_11,"est")){
if(contains_vowel(_11.substring(0,_11.length-3))){
_11=_11.substring(0,_11.length-3);
steps[steps.length]=["1b) (*v*) EST -> ",_11];
}else{
break;
}
}else{
if(_12&&endswith(_11,"eth")){
if(contains_vowel(_11.substring(0,_11.length-3))){
_11=_11.substring(0,_11.length-3);
steps[steps.length]=["1b) (*v*) ETH -> ",_11];
}else{
break;
}
}else{
if(_12&&endswith(_11,"ingly")){
if(contains_vowel(_11.substring(0,_11.length-5))){
_11=_11.substring(0,_11.length-5);
steps[steps.length]=["1b) (*v*) INGLY -> ",_11];
}else{
break;
}
}else{
if(_12&&endswith(_11,"edst")){
if(contains_vowel(_11.substring(0,_11.length-4))){
_11=_11.substring(0,_11.length-4);
steps[steps.length]=["1b) (*v*) EDST -> ",_11];
}else{
break;
}
}else{
break;
}
}
}
}
}
}
if(endswith(_11,"at")){
_11+="e";
steps[steps.length]=["1b) AT -> ATE",_11];
}else{
if(endswith(_11,"bl")){
_11+="e";
steps[steps.length]=["1b) BL -> BLE",_11];
}else{
if(endswith(_11,"iz")){
_11+="e";
steps[steps.length]=["1b) IZ -> IZE",_11];
}else{
if(ends_with_double_c(_11)&&_11.charAt(_11.length-1)!="l"&&_11.charAt(_11.length-1)!="s"&&_11.charAt(_11.length-1)!="z"){
_11=_11.substring(0,_11.length-1);
steps[steps.length]=["1b) (*d and not (*L or *S or *Z)) -> single letter",_11];
}else{
if(m(_11)==1&&ends_with_cvc(_11)){
_11+="e";
steps[steps.length]=["1b) (m=1 and *o) -> E",_11];
}
}
}
}
}
}while(0);
if(endswith(_11,"y")&&contains_vowel(_11.substring(0,_11.length-1))){
_11=_11.substring(0,_11.length-1)+"i";
steps[steps.length]=["1c) (*v*) Y -> I",_11];
}
if(endswith(_11,"enci")){
if(m(_11.substring(0,_11.length-4))>0){
_11=_11.substring(0,_11.length-1)+"e";
steps[steps.length]=["2) (m>0) ENCI -> ENCE",_11];
}
}else{
if(endswith(_11,"ational")){
if(m(_11.substring(0,_11.length-7))>0){
_11=_11.substring(0,_11.length-5)+"e";
steps[steps.length]=["2) (m>0) ATIONAL -> ATE",_11];
}
}else{
if(endswith(_11,"tional")){
if(m(_11.substring(0,_11.length-6))>0){
_11=_11.substring(0,_11.length-2);
steps[steps.length]=["2) (m>0) TIONAL -> TION",_11];
}
}else{
if(endswith(_11,"izer")){
if(m(_11.substring(0,_11.length-4))>0){
_11=_11.substring(0,_11.length-1);
steps[steps.length]=["2) (m>0) IZER -> IZE",_11];
}
}else{
if(endswith(_11,"ization")){
if(m(_11.substring(0,_11.length-7))>0){
_11=_11.substring(0,_11.length-5)+"e";
steps[steps.length]=["2) (m>0) IZATION -> IZE",_11];
}
}else{
if(endswith(_11,"alism")){
if(m(_11.substring(0,_11.length-5))>0){
_11=_11.substring(0,_11.length-3);
steps[steps.length]=["2) (m>0) ALISM -> AL",_11];
}
}else{
if(endswith(_11,"anci")){
if(m(_11.substring(0,_11.length-4))>0){
_11=_11.substring(0,_11.length-1)+"e";
steps[steps.length]=["2) (m>0) ANCI -> ANCE",_11];
}
}else{
if(endswith(_11,"bli")){
if(m(_11.substring(0,_11.length-3))>0){
_11=_11.substring(0,_11.length-1)+"e";
steps[steps.length]=["2) (m>0) BLI -> BLE",_11];
}
}else{
if(endswith(_11,"alli")){
if(m(_11.substring(0,_11.length-4))>0){
_11=_11.substring(0,_11.length-2);
steps[steps.length]=["2) (m>0) ALLI -> AL",_11];
}
}else{
if(endswith(_11,"entli")){
if(m(_11.substring(0,_11.length-5))>0){
_11=_11.substring(0,_11.length-2);
steps[steps.length]=["2) (m>0) ENTLI -> ENT",_11];
}
}else{
if(endswith(_11,"eli")){
if(m(_11.substring(0,_11.length-3))>0){
_11=_11.substring(0,_11.length-2);
steps[steps.length]=["2) (m>0) ELI -> E",_11];
}
}else{
if(!_12&&endswith(_11,"ousli")){
if(m(_11.substring(0,_11.length-5))>0){
_11=_11.substring(0,_11.length-2);
steps[steps.length]=["2) (m>0) OUSLI -> OUS",_11];
}
}else{
if(_12&&endswith(_11,"ousli")){
if(m(_11.substring(0,_11.length-5))>0){
_11=_11.substring(0,_11.length-3);
steps[steps.length]=["2) (m>0) OUSLI -> OU",_11];
}
}else{
if(endswith(_11,"ation")){
if(m(_11.substring(0,_11.length-5))>0){
_11=_11.substring(0,_11.length-3)+"e";
steps[steps.length]=["2) (m>0) ATION -> ATE",_11];
}
}else{
if(endswith(_11,"ator")){
if(m(_11.substring(0,_11.length-4))>0){
_11=_11.substring(0,_11.length-2)+"e";
steps[steps.length]=["2) (m>0) ATOR -> ATE",_11];
}
}else{
if(endswith(_11,"iveness")){
if(m(_11.substring(0,_11.length-7))>0){
_11=_11.substring(0,_11.length-4);
steps[steps.length]=["2) (m>0) IVENESS -> IVE",_11];
}
}else{
if(endswith(_11,"fulness")){
if(m(_11.substring(0,_11.length-7))>0){
_11=_11.substring(0,_11.length-4);
steps[steps.length]=["2) (m>0) FULNESS -> FUL",_11];
}
}else{
if(!_12&&endswith(_11,"ousness")){
if(m(_11.substring(0,_11.length-7))>0){
_11=_11.substring(0,_11.length-4);
steps[steps.length]=["2) (m>0) OUSNESS -> OUS",_11];
}
}else{
if(_12&&endswith(_11,"ousness")){
if(m(_11.substring(0,_11.length-7))>0){
_11=_11.substring(0,_11.length-5);
steps[steps.length]=["2) (m>0) OUSNESS -> OU",_11];
}
}else{
if(endswith(_11,"aliti")){
if(m(_11.substring(0,_11.length-5))>0){
_11=_11.substring(0,_11.length-3);
steps[steps.length]=["2) (m>0) ALITI -> AL",_11];
}
}else{
if(endswith(_11,"iviti")){
if(m(_11.substring(0,_11.length-5))>0){
_11=_11.substring(0,_11.length-3)+"e";
steps[steps.length]=["2) (m>0) IVITI -> IVE",_11];
}
}else{
if(endswith(_11,"biliti")){
if(m(_11.substring(0,_11.length-6))>0){
_11=_11.substring(0,_11.length-5)+"le";
steps[steps.length]=["2) (m>0) BILITI -> BLE",_11];
}
}else{
if(endswith(_11,"logi")){
if(m(_11.substring(0,_11.length-4))>0){
_11=_11.substring(0,_11.length-1);
steps[steps.length]=["2) (m>0) LOGI -> LOG",_11];
}
}else{
if(_12&&endswith(_11,"antli")){
if(m(_11.substring(0,_11.length-5))>0){
_11=_11.substring(0,_11.length-2);
steps[steps.length]=["2) (m>0) ANTLI -> ANT",_11];
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
if(endswith(_11,"icate")){
if(m(_11.substring(0,_11.length-5))>0){
_11=_11.substring(0,_11.length-3);
steps[steps.length]=["3) (m>0) ICATE -> IC",_11];
}
}else{
if(endswith(_11,"ative")){
if(m(_11.substring(0,_11.length-5))>0){
_11=_11.substring(0,_11.length-5);
steps[steps.length]=["3) (m>0) ATIVE -> ",_11];
}
}else{
if(endswith(_11,"alize")){
if(m(_11.substring(0,_11.length-5))>0){
_11=_11.substring(0,_11.length-3);
steps[steps.length]=["3) (m>0) ALIZE -> AL",_11];
}
}else{
if(endswith(_11,"iciti")){
if(m(_11.substring(0,_11.length-5))>0){
_11=_11.substring(0,_11.length-3);
steps[steps.length]=["3) (m>0) ICITI -> IC",_11];
}
}else{
if(endswith(_11,"ical")){
if(m(_11.substring(0,_11.length-4))>0){
_11=_11.substring(0,_11.length-2);
steps[steps.length]=["3) (m>0) ICAL -> IC",_11];
}
}else{
if(endswith(_11,"ful")){
if(m(_11.substring(0,_11.length-3))>0){
_11=_11.substring(0,_11.length-3);
steps[steps.length]=["3) (m>0) FUL -> ",_11];
}
}else{
if(endswith(_11,"ness")){
if(m(_11.substring(0,_11.length-4))>0){
_11=_11.substring(0,_11.length-4);
steps[steps.length]=["3) (m>0) NESS -> ",_11];
}
}
}
}
}
}
}
}
if(endswith(_11,"al")){
if(m(_11.substring(0,_11.length-2))>1){
_11=_11.substring(0,_11.length-2);
steps[steps.length]=["4) (m>1) AL -> ",_11];
}
}else{
if(endswith(_11,"ance")){
if(m(_11.substring(0,_11.length-4))>1){
_11=_11.substring(0,_11.length-4);
steps[steps.length]=["4) (m>1) ANCE -> ",_11];
}
}else{
if(endswith(_11,"ence")){
if(m(_11.substring(0,_11.length-4))>1){
_11=_11.substring(0,_11.length-4);
steps[steps.length]=["4) (m>1) ENCE -> ",_11];
}
}else{
if(endswith(_11,"er")){
if(m(_11.substring(0,_11.length-2))>1){
_11=_11.substring(0,_11.length-2);
steps[steps.length]=["4) (m>1) ER -> ",_11];
}
}else{
if(endswith(_11,"ic")){
if(m(_11.substring(0,_11.length-2))>1){
_11=_11.substring(0,_11.length-2);
steps[steps.length]=["4) (m>1) IC -> ",_11];
}
}else{
if(endswith(_11,"able")){
if(m(_11.substring(0,_11.length-4))>1){
_11=_11.substring(0,_11.length-4);
steps[steps.length]=["4) (m>1) ABLE -> ",_11];
}
}else{
if(endswith(_11,"ible")){
if(m(_11.substring(0,_11.length-4))>1){
_11=_11.substring(0,_11.length-4);
steps[steps.length]=["4) (m>1) IBLE -> ",_11];
}
}else{
if(endswith(_11,"ant")){
if(m(_11.substring(0,_11.length-3))>1){
_11=_11.substring(0,_11.length-3);
steps[steps.length]=["4) (m>1) ANT -> ",_11];
}
}else{
if(endswith(_11,"ement")){
if(m(_11.substring(0,_11.length-5))>1){
_11=_11.substring(0,_11.length-5);
steps[steps.length]=["4) (m>1) EMENT -> ",_11];
}
}else{
if(endswith(_11,"ment")){
if(m(_11.substring(0,_11.length-4))>1){
_11=_11.substring(0,_11.length-4);
steps[steps.length]=["4) (m>1) MENT -> ",_11];
}
}else{
if(endswith(_11,"ent")){
if(m(_11.substring(0,_11.length-3))>1){
_11=_11.substring(0,_11.length-3);
steps[steps.length]=["4) (m>1) ENT -> ",_11];
}
}else{
if(endswith(_11,"ion")){
if(m(_11.substring(0,_11.length-3))>1&&(_11.charAt(_11.length-4)=="s"||_11.charAt(_11.length-4)=="t")){
_11=_11.substring(0,_11.length-3);
steps[steps.length]=["4) ((m>1) and (*S or *T)) ION -> ",_11];
}
}else{
if(endswith(_11,"ou")){
if(m(_11.substring(0,_11.length-2))>1){
_11=_11.substring(0,_11.length-2);
steps[steps.length]=["4) (m>1) OU -> ",_11];
}
}else{
if(endswith(_11,"ate")){
if(m(_11.substring(0,_11.length-3))>1){
_11=_11.substring(0,_11.length-3);
steps[steps.length]=["4) (m>1) ATE -> ",_11];
}
}else{
if(endswith(_11,"iti")){
if(m(_11.substring(0,_11.length-3))>1){
_11=_11.substring(0,_11.length-3);
steps[steps.length]=["4) (m>1) ITI -> ",_11];
}
}else{
if(endswith(_11,"ous")){
if(m(_11.substring(0,_11.length-3))>1){
_11=_11.substring(0,_11.length-3);
steps[steps.length]=["4) (m>1) OUS -> ",_11];
}
}else{
if(endswith(_11,"ive")){
if(m(_11.substring(0,_11.length-3))>1){
_11=_11.substring(0,_11.length-3);
steps[steps.length]=["4) (m>1) IVE -> ",_11];
}
}else{
if(endswith(_11,"ism")){
if(m(_11.substring(0,_11.length-3))>1){
_11=_11.substring(0,_11.length-3);
steps[steps.length]=["4) (m>1) ISM -> ",_11];
}
}else{
if(endswith(_11,"ize")){
if(m(_11.substring(0,_11.length-3))>1){
_11=_11.substring(0,_11.length-3);
steps[steps.length]=["4) (m>1) IZE -> ",_11];
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
if(endswith(_11,"e")){
var m_=m(_11.substring(0,_11.length-1));
if(m_>1){
_11=_11.substring(0,_11.length-1);
steps[steps.length]=["5a) (m>1) E -> ",_11];
}else{
if(m_==1&&!ends_with_cvc(_11.substring(0,_11.length-1))){
_11=_11.substring(0,_11.length-1);
steps[steps.length]=["5a) (m=1 and not *o) E -> ",_11];
}
}
}
if(endswith(_11,"ll")){
if(m(_11)>1){
_11=_11.substring(0,_11.length-1);
steps[steps.length]=["5b) (m>1 and *d and *L) -> single letter",_11];
}
}
return _11;
}

