R/fs6.R

fs6 <-
function(word){
  suf2 <- c('\u0647\u0627', # 'ha': plural maker
            '\u0627\u0646', # 'an': plural maker
            '\u06CC\u0646', # 'in': plural maker
            '\u062A\u0631') # 'tar': comparative adjective maker
  if(length(word) >4){
    if(paste(word[(length(word)-1):length(word)],collapse="") %in% suf2){
      word <- word[1:(length(word)-2)]}}; return(word)}

Try the PersianStemmer package in your browser

Any scripts or data that you put into this service are public.

PersianStemmer documentation built on June 28, 2019, 5:03 p.m.