if (FALSE) {
txt = 'Bob said that he likes Mary. John did not like that:
"how dare he!". "It is I, John, who likes Mary!!"'
tc = udpipe_tcorpus(txt, model = 'english-ewt')
tc$udpipe_quotes()
if (interactive()) {
tc_plot_tree(tc, token, lemma, POS, annotation='quote')
browse_texts(tc, rsyntax='quote', value='source')
}
## you can provide your own lists of tqueries, or use the two
## query generating functions to customize the specific 'verb lemma'
## (i.e. the lemma for verbs that indicate speech)
custom_verb_lemma = c('say','state') ## this should be longer
quote_tqueries = udpipe_quote_tqueries(custom_verb_lemma)
span_quote_tqueries = udpipe_spanquote_tqueries(custom_verb_lemma)
## note that these use simply lists with tqueries, so you can also
## create your own list or customize these lists
quote_tqueries
span_quote_tqueries
if (interactive()) {
tc$udpipe_quotes(tqueries = quote_tqueries, span_tqueries = span_quote_tqueries)
tc_plot_tree(tc, token, lemma, POS, annotation='quote')
browse_texts(tc, rsyntax='quote', value='source')
}
}
Run the code above in your browser using DataLab