Concordancing, also known as Keyword in Context (KWIC), is an efficient way to see how some linguistic phenomenon of interest is behaving in context.
Concordancing works on any Dataset, be it a whole corpus or a search result. For example, to concordance words ending in -ing:
from buzz import Corpus
dtrt = Corpus('dtrt/do-the-right-thing-parsed')
ing = dtrt.just.words('ing$')
ing.conc()
Below are the keyword arguments accepted by the conc
method:
Argument | Default | Purpose |
---|---|---|
show | ['w'] |
A list of attributes to show in the match column. |
n | 100 |
Stop after producing this many lines |
window | 'auto' |
Size of left and right columns, as integer or tuple of two integers. auto will attempt to use your display size intelligently |
metadata | True /list |
Add metadata info as extra columns (you can provide a list of metadata fields you want to include) |
ing.head().to_html()
left | match | right | file | s | camera_angle | line | loc | scene | sent_id | setting | speaker | stage_direction | text | time | voice-delivery | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | K , shows that Mister Señor Love Daddy is actually | sitting | in a storefront window . The control booth looks d | 01-we-love-radio-station-storefront | 12 | NaN | 2 | INT | 1 | 12 | WE LOVE RADIO STATION STOREFRONT | MISTER SEÑOR LOVE DADDY | True | The last on your dial, but the first in ya hear... | DAY | NaN |
1 | s is WE LOVE RADIO , a modest station with a loyal | following | , * right in the heart of the neighborhood . The O | 01-we-love-radio-station-storefront | 14 | NaN | _ | INT | 1 | 14 | WE LOVE RADIO STATION STOREFRONT | _ | True | This is WE LOVE RADIO, a modest station with a ... | DAY | NaN |
2 | t . It ya know . This is Mister Señor Love Daddy , | doing | the nasty to ya ears , ya ears to the nasty . I'se | 01-we-love-radio-station-storefront | 20 | NaN | 3 | INT | 1 | 20 | WE LOVE RADIO STATION STOREFRONT | MISTER SEÑOR LOVE DADDY | True | This is Mister Señor Love Daddy, doing the nast... | DAY | NaN |
3 | we hear a station jingle . L - O - V - E RADIO .. | Doing | da ying and yang da flip and Doing da ying and yan | 01-we-love-radio-station-storefront | 25 | NaN | 5 | INT | 1 | 25 | WE LOVE RADIO STATION STOREFRONT | MISTER SEÑOR LOVE DADDY | True | Doing da ying and yang da flip and Doing da yin... | DAY | NaN |
4 | a station jingle . L - O - V - E RADIO .. Doing da | ying | and yang da flip and Doing da ying and yang da fli | 01-we-love-radio-station-storefront | 25 | NaN | 5 | INT | 1 | 25 | WE LOVE RADIO STATION STOREFRONT | MISTER SEÑOR LOVE DADDY | True | Doing da ying and yang da flip and Doing da yin... | DAY | NaN |