Concordance in Text Processing

Dear Kilian:

 

Is there a way to do concordancing [extracting pre-specified number of words before and after a particular word] in KNIME Text Processing?  

 

I searched for the word concordance and also skimmed through the text processing forum before making this query in the forum.  My apologies if this is already addressed and in which case, kindly provide the link.

 

Thanks in anticipation.

 

SridharVenu

Hi SridharVenu,

there is no dedicated node for concordancing. However, you can use the NGram node alternatively and filter out all ngrams that do not contain the specified word you are looking for. The rest of the ngrams contain that word and have words before and after it. To extract these words you need to o a bit of string manipulation.

Alternatively you could implement that node yourself. A Document instance (which is conatined in document cells) can be accessed on a sentence, term and word level. It is possbile to extract that information from the underlying data structure without any problems.

Cheers, Kilian