1 ! Copyright (C) 2008 Marc Fauconneau.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: arrays help.markup help.syntax io.streams.string
4 sequences strings math suffix-arrays.private ;
10 { "suffix-array" array } }
11 { $description "Creates a suffix array from the input sequence. Suffix arrays are arrays of slices." } ;
14 { $description "Creates a new literal suffix array at parse-time." } ;
19 { "suffixes-seq" "a sequence of slices" } }
20 { $description "Returns a sequence of tail slices of the input string." } ;
24 { "begin" sequence } { "suffix-array" "a suffix-array" }
26 { $description "Returns a sequence of sequences from the suffix-array that contain the input sequence. An empty array is returned when there are no matches." } ;
28 ARTICLE: "suffix-arrays" "Suffix arrays"
29 "The " { $vocab-link "suffix-arrays" } " vocabulary implements the suffix array data structure for efficient lookup of subsequences. This suffix array implementation is a sorted array of suffixes. Querying it for matches uses binary search for efficiency." $nl
31 "Creating new suffix arrays:"
32 { $subsections >suffix-array }
33 "Literal suffix arrays:"
34 { $subsections POSTPONE: SA{ }
35 "Querying suffix arrays:"
36 { $subsections query } ;
38 ABOUT: "suffix-arrays"