Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function parseTextForTopics(text) {
// return(nlp(text).topics().out('topk'));
return(nlp(text).topics().slice(0, 30).out('frequency'));
}
export function normalizeText(text) {
return (nlp(text).normalize());
}
shared_text: {
position: 'absolute',
top: 0,
left: 0,
width: '100%',
fontFamily: 'Helvetica',
fontSize: 20,
padding: '10px 15px 0px 15px',
margin: 0,
color: 'grey'
}
}
this.state = {
text: props.text,
trailing: '',
parsed: nlp(props.text)
}
this.overlay = this.overlay.bind(this)
this.onChange = this.onChange.bind(this)
this.hiddenText = this.hiddenText.bind(this)
}
export function parseTextForDates(text) {
return(nlp('text').dates().slice(0, 50).out('frequency'));
}
export function parseTextForPlaces(text) {
return(nlp(text).places().slice(0, 50).out('frequency'));
}
export function parseTextForTrigrams(text) {
return(nlp(text).ngrams().trigrams().slice(0, 30).out('frequency'));
}
onChange() {
let {state} = this
let el = this.refs.textarea
if (el) {
state.text = el.value
state.parsed = nlp(state.text)
}
state.trailing = state.text.match(/\s+$/) || ''
this.setState(state)
}
export function parseTextForTerms(text) {
return(filterCommonWords(nlp(text).terms().slice(0, 30).out('frequency')));
}
export function parseTextForBigrams(text) {
return(nlp(text).ngrams().bigrams().slice(0, 30).out('frequency'));
}
export function parseTextForQuotes(text) {
return(nlp(text).quotations().slice(0, 50).out('frequency'));
}