# NOT RUN { x <- c( 'the dirtier dog has eaten the pies', 'that shameful pooch is tricky and sneaky', "He opened and then reopened the food bag", 'There are skies of blue and red roses too!', NA, "The doggies, well they aren't joyfully running.", "The daddies are coming over...", "This is 34.546 above" ) ## Default lexicon::hash_lemmas dictionary lemmatize_strings(x) ## Hunspell dictionary lemma_dictionary <- make_lemma_dictionary(x, engine = 'hunspell') lemmatize_strings(x, dictionary = lemma_dictionary) ## Bigger data set library(dplyr) presidential_debates_2012$dialogue %>% lemmatize_strings() %>% head() # } # NOT RUN { ## Treetagger dictionary lemma_dictionary2 <- make_lemma_dictionary(x, engine = 'treetagger') lemmatize_strings(x, lemma_dictionary2) lemma_dictionary3 <- presidential_debates_2012$dialogue %>% make_lemma_dictionary(engine = 'treetagger') presidential_debates_2012$dialogue %>% lemmatize_strings(lemma_dictionary3) %>% head() # }
Run the code above in your browser using DataCamp Workspace