Skip to main content

get

Function get 

Source
pub fn get<T: AsRef<str>>(input_language: T) -> &'static [&'static str]
Expand description

This function fetches stop words for a language using either a member of the LANGUAGE enum or a lookup code as any type implementing std::convert::AsRef<str>. For most languages the lookup code is a two-character ISO 639-1 code. Constructed languages use three-character codes (dot, dov, nav, qya, sjn, tlh, val), and NLTK-specific hinglish is supported when the nltk feature is enabled.

let first_list = stop_words::get("ar");
let second_list = stop_words::get(stop_words::LANGUAGE::Arabic);
assert_eq!(first_list, second_list)

§Panics

Panics if the provided language code is not recognized.