R/termfilter.R

Defines functions expand_filter_type getTermFilter getFilterTypes

Documented in getFilterTypes getTermFilter

WN_filter_types <-
    c("ContainsFilter", "EndsWithFilter", "ExactMatchFilter",
      "RegexFilter", "SoundFilter", "StartsWithFilter",
      "WildcardFilter")

getFilterTypes <-
function()
    WN_filter_types

getTermFilter <-
function(type, word, ignoreCase)
{
    type <- .expand_filter_type(type[1L])
    .jnew(paste0("com.nexagis.jawbone.filter.", type),
          word, ignoreCase)
}

.expand_filter_type <-
function(x)
{
    y <- pmatch(tolower(x), tolower(WN_filter_types))
    if(is.na(y))
        stop(sprintf("Unknown filter type '%s'", x))
    WN_filter_types[y]
}

Try the wordnet package in your browser

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

wordnet documentation built on Nov. 26, 2017, 5:06 p.m.