Find the longest suffix among the ones specified
        and perform the required action.
11849
def replace_suffixes_2(self, word):
        
        has_vowel = False

        if word.endswith('eed'):
            if len(word) >= self.r1:
                word = word[:-3] + 'ee'
            return word

        elif word.endswith('eedly'):
            if len(word) >= self.r1:
                word = word[:-5] + 'ee'
            return word

        elif word.endswith('ed'):
            for vowel in self.vowels:
                if vowel in word[:-2]:
                    has_vowel = True
                    word = word[:-2]
                    break

        elif word.endswith('edly'):
            for vowel in self.vowels:
                if vowel in word[:-4]:
                    has_vowel = True
                    word = word[:-4]
                    break

        elif word.endswith('ing'):
            for vowel in self.vowels:
                if vowel in word[:-3]:
                    has_vowel = True
                    word = word[:-3]
                    break

        elif word.endswith('ingly'):
            for vowel in self.vowels:
                if vowel in word[:-5]:
                    has_vowel = True
                    word = word[:-5]
                    break

        # Be sure to only perform one of these.
        if has_vowel:
            length = len(word)
            if word[length - 2:] in ['at', 'bl', 'iz']:
                word += 'e'
            elif word[length - 2:] in self.doubles:
                word = word[:-1]
            elif self.is_short(word):
                word += 'e'

        return word
861601
def p_suffix(self, length=None, elipsis=False):
        ""
        if length is not None:
            result = self.input[self.pos:self.pos + length]
            if elipsis and len(result) == length:
                result += "..."
            return result
        return self.input[self.pos:]
1027353
function suffixLength(text, suffix) {
  let exp = new RegExp(`${suffix.pattern}$`);
  return matchLength(text, exp);
}
1187831
public function step4()
    {
        // Search for the longest among the suffixes "a   e   i   ie   ă " and, if it is in RV, delete it.
        if ( ($position = $this->search(array('a', 'ie', 'e', 'i', 'ă'))) !== false) {
            if ($this->inRv($position)) {
                $this->word = Utf8::substr($this->word, 0, $position);
            }
        }

        return true;
    }
31804
function getSuffix(suffix) {
  suffix = (suffix.slice(0, 1) === ' ') ?
    suffix :
    suffix.replace(/.+?(?=\s)/, '');
  suffix = suffix.slice(1, suffix.length);
  return suffix;
}
134072
def add_suffix(path, suffix=""):
    """"""
    return join(dirname(path), basename(path, ext=False) + suffix + extname(path))
1006201
def add_suffix(file_path, suffix):
    """"""
    split = os.path.basename(file_path).rsplit('.', 1)
    ext = split[1]
    name = split[0]
    out = str(name + '_' + suffix + '.' + ext)
    return os.path.join(os.path.dirname(file_path), out)
557527
private String findLongestCommand(String prefix) {
		String result = methodTargets.keySet().stream()
				.filter(command -> prefix.equals(command) || prefix.startsWith(command + " "))
				.reduce("", (c1, c2) -> c1.length() > c2.length() ? c1 : c2);
		return "".equals(result) ? null : result;
	}
1154448
@Nonnull
    public Word<I> longestCommonSuffix(Word<?> other) {
        int len = length(), otherLen = other.length();
        int minLen = (len < otherLen) ? len : otherLen;

        int idx1 = len, idx2 = otherLen;
        int i = 0;
        while (i < minLen) {
            I sym1 = getSymbol(--idx1);
            Object sym2 = other.getSymbol(--idx2);

            if (!Objects.equals(sym1, sym2)) {
                break;
            }

            i++;
        }

        return suffix(i);
    }
403481
private void fixActiveEdgeAfterSuffixLink(Suffix<T, S> suffix) {
        while (activeEdge != null && activeLength > activeEdge.getLength()) {
            activeLength = activeLength - activeEdge.getLength();
            activeNode = activeEdge.getTerminal();
            Object item = suffix.getItemXFromEnd(activeLength + 1);
            activeEdge = activeNode.getEdgeStarting(item);
        }
        resetActivePointToTerminal();
    }
979876
def _clean_suffix(string, suffix):
    
    suffix_len = len(suffix)

    if len(string) < suffix_len:
        # the string param was shorter than the suffix
        raise ValueError("A suffix can not be bigger than string argument.")
    if string.endswith(suffix):
        # return from the beginning up to
        # but not including the first letter
        # in the suffix
        return string[0:-suffix_len]
    else:
        # leave unharmed
        return string
1098210
def longest_one_seg_prefix(self, word):
        
        match = self.seg_regex.match(word)
        if match:
            return match.group(0)
        else:
            return ''
416467
boolean checkSuffix(char[] chars, int[] cursor) {
    if (suffix == null)
      return true;
    // Compute the only possible starting point. This only works because a clause's minlen
    // is an exact length for SQL-style patterns.  This method is overridden for topic
    // patterns.
    int start = cursor[1] - suffix.minlen;
    if (start < cursor[0])
      // candidate is too short to possibly match
      return false;
    if (!matchClause(suffix, chars, new int[] {start, cursor[1]}))
      return false;
    // The suffix matches, so reflect that in the cursor
    cursor[1] = start;
    return true;
  }
509320
public static Pattern longest(final Pattern... patterns) {
    return new Pattern() {
      @Override
      public int match(CharSequence src, int begin, int end) {
        int r = MISMATCH;
        for (Pattern pattern : patterns) {
          int l = pattern.match(src, begin, end);
          if (l > r)
            r = l;
        }
        return r;
      }
    };
  }
255374
def combined_properties(self, suffix):
        

        props = [y for x, y in self.settings.items() if x.endswith(suffix)]
        properties = itertools.chain(*props)

        processed_props = [x for x in properties]
        return processed_props
87058
def ends_with(self, suffix):
        
        suffix = suffix.lower()
        found_words = []

        res = cgaddag.gdg_ends_with(self.gdg, suffix.encode(encoding="ascii"))
        tmp = res

        while tmp:
            word = tmp.contents.str.decode("ascii")
            found_words.append(word)
            tmp = tmp.contents.next

        cgaddag.gdg_destroy_result(res)
        return found_words
937928
def register_suffixes (suffixes, type):
    
    assert is_iterable_typed(suffixes, basestring)
    assert isinstance(type, basestring)
    for s in suffixes:
        if s in __suffixes_to_types:
            old_type = __suffixes_to_types [s]
            if old_type != type:
                raise BaseException ('Attempting to specify type for suffix "%s"\nOld type: "%s", New type "%s"' % (s, old_type, type))
        else:
            __suffixes_to_types [s] = type