formatted(self,
leftRegexp=None,
middleRegexp=' .* ' ,
rightRegexp=None,
leftContextLength=3,
rightContextLength=3,
contextInSentences=True,
contextChars=50,
maxKeyLength=0,
showWord=True,
sort=0,
showPOS=True,
flipWordAndPOS=True,
verbose=True)
| source code
|
Generates and displays keyword-in-context formatted concordance
data.
This is a convenience method that combines raw() and display()'s
options. Unless you need raw output, this is probably the most useful
method.
- Parameters:
leftRegexp (string) - Regular expression applied to the left context to filter output.
Defaults to None.
middleRegexp (string) - Regular expression applied to target word to filter output.
Defaults to ".*" (ie everything).
rightRegexp (string) - Regular expression applied to the right context to filter output.
Defaults to None.
leftContextLength (number) - Length of left context. Defaults to 3.
rightContextLength (number) - Length of right context. Defaults to 3.
contextInSentences (number) - Determines whether the context lengths arguments are in words or
sentences. If false, the context lengths are in words - a
rightContextLength argument of 2 results in two words of right
context. If true, a rightContextLength argument of 2 results in a
right context consisting of the portion of the target word's
sentence to the right of the target, plus the two sentences to
the right of that sentence. Defaults to False. @type contextChars
number
contextChars - Amount of context to show. If set to less than 0, does not limit
amount of context shown (may look ugly). Defaults to 55.
maxKeyLength (number) - Max number of characters to show for the target word. If 0 or
less, this value is calculated so as to fully show all target
words. Defaults to 0.
showWord (boolean) - Whether to show words. Defaults to True.
sort (integer) - Should be set to one the provided SORT constants. If SORT_WORD,
the output is sorted on the target word. If SORT_POS, the output
is sorted on the target word's POS tag. If SORT_NUM, the output
is sorted by sentence number. If SORT_RIGHT_CONTEXT, the output
is sorted on the first word of the right context. Defaults to
SORT_WORD.
showPOS (boolean) - Whether to show POS tags. Defaults to True.
flipWordAndPOS (boolean) - If true, displays POS tags first instead of words (ie prints
'cc/and' instead of 'and/cc'). Defaults to False.
verbose (boolean) - Displays some extra status information. Defaults to False.
|