Abstract
KWIC (Key Word In Context) is a venerable method for indexing text. This publication describes a Python-language module to assist in the generation of KWIC indexes.
This publication is available in Web form and also as a PDF document. Please
forward any comments to tcc-doc@nmt.edu.
Table of Contents
kwic module: prologueclass KwicIndex: The entire
indexKwicIndex.__init__():
ConstructorKwicIndex.__makeStopSet(): Build the
internal stop listKwicIndex.__makeUni(): Force Unicode
representationKwicIndex.__findKeywords(): Find all the
keywords in a lineKwicIndex.__isStart(): Test for a
keyword start characterKwicIndex.__isWord(): Test for a
keyword characterKwicIndex.index(): Index a line of
textKwicIndex.__addRef(): Add one
referenceKwicIndex.genWords(): Generate the index
entriesclass KwicWord: All references to one
keywordclass KwicRef: Record of one reference to
one keywordkwictest: A small test driverstop_words file