KeywordInContextIndexBuilder.st
changeset 4125 d597206782cc
parent 4124 2d4e83bec872
child 4126 4d3ec803fddf
equal deleted inserted replaced
4124:2d4e83bec872 4125:d597206782cc
    38 
    38 
    39 documentation
    39 documentation
    40 "
    40 "
    41     A support class for building a KWIC (Keyword in Context) index.
    41     A support class for building a KWIC (Keyword in Context) index.
    42     (for example, to build a KWIC index on html pages or class documentation).
    42     (for example, to build a KWIC index on html pages or class documentation).
       
    43     
    43     To generate a kwic, add each line together with a reference (or page number, or whatever),
    44     To generate a kwic, add each line together with a reference (or page number, or whatever),
    44     using addLine:reference:.
    45     using addLine:reference:.
    45     Then, when finished, enumerate the kwic.
    46     Then, when finished, enumerate the kwic.
    46 
    47 
    47     [author:]
    48     [author:]
    50     [instance variables:]
    51     [instance variables:]
    51 
    52 
    52     [class variables:]
    53     [class variables:]
    53 
    54 
    54     [see also:]
    55     [see also:]
    55 
    56         https://en.wikipedia.org/wiki/Key_Word_in_Context (english)
       
    57         https://de.wikipedia.org/wiki/Permutiertes_Register (german)
       
    58         
    56 "
    59 "
    57 !
    60 !
    58 
    61 
    59 examples
    62 examples
    60 "
    63 "
    63 
    66 
    64     kwic := KeywordInContextIndexBuilder new.
    67     kwic := KeywordInContextIndexBuilder new.
    65     kwic excluded:#('the' 'and' 'a' 'an').
    68     kwic excluded:#('the' 'and' 'a' 'an').
    66 
    69 
    67     kwic addLine:'bla bla bla' reference:1.
    70     kwic addLine:'bla bla bla' reference:1.
       
    71     kwic addLine:'foo, bar. baz' reference:1.
    68     kwic addLine:'one two three' reference:2.
    72     kwic addLine:'one two three' reference:2.
    69     kwic addLine:'a cat and a dog' reference:3.
    73     kwic addLine:'a cat and a dog' reference:3.
    70     kwic addLine:'the man in the middle' reference:4.
    74     kwic addLine:'the man in the middle' reference:4.
    71     kwic addLine:'the man with the dog' reference:5.
    75     kwic addLine:'the man with the dog' reference:5.
    72 
    76