FlibDivSufSort is pretty easy to use
1: 2: |
|
First you initialize your SuffixArray with some bytes you'll be searching. In this case we're using text.
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: |
|
You can then search that string for a pattern, in this case the word february.
1:
|
|
This returns [|43L; 19L|] which are the offsets of the word February in the text.
module Flibdivsufsort
namespace System
namespace System.Text
val testStr : string
Full name: Tutorial.testStr
Full name: Tutorial.testStr
val sa : SuffixArray
Full name: Tutorial.sa
Full name: Tutorial.sa
Multiple items
type SuffixArray =
new : input:byte [] -> SuffixArray
member IsCorrect : unit -> bool
member Search : query:byte [] -> int64 []
Full name: Flibdivsufsort.SuffixArray
--------------------
new : input:byte [] -> SuffixArray
type SuffixArray =
new : input:byte [] -> SuffixArray
member IsCorrect : unit -> bool
member Search : query:byte [] -> int64 []
Full name: Flibdivsufsort.SuffixArray
--------------------
new : input:byte [] -> SuffixArray
type Encoding =
member BodyName : string
member Clone : unit -> obj
member CodePage : int
member DecoderFallback : DecoderFallback with get, set
member EncoderFallback : EncoderFallback with get, set
member EncodingName : string
member Equals : value:obj -> bool
member GetByteCount : chars:char[] -> int + 3 overloads
member GetBytes : chars:char[] -> byte[] + 5 overloads
member GetCharCount : bytes:byte[] -> int + 2 overloads
...
Full name: System.Text.Encoding
member BodyName : string
member Clone : unit -> obj
member CodePage : int
member DecoderFallback : DecoderFallback with get, set
member EncoderFallback : EncoderFallback with get, set
member EncodingName : string
member Equals : value:obj -> bool
member GetByteCount : chars:char[] -> int + 3 overloads
member GetBytes : chars:char[] -> byte[] + 5 overloads
member GetCharCount : bytes:byte[] -> int + 2 overloads
...
Full name: System.Text.Encoding
property Encoding.ASCII: Encoding
Encoding.GetBytes(s: string) : byte []
Encoding.GetBytes(chars: char []) : byte []
Encoding.GetBytes(chars: char [], index: int, count: int) : byte []
Encoding.GetBytes(chars: nativeptr<char>, charCount: int, bytes: nativeptr<byte>, byteCount: int) : int
Encoding.GetBytes(s: string, charIndex: int, charCount: int, bytes: byte [], byteIndex: int) : int
Encoding.GetBytes(chars: char [], charIndex: int, charCount: int, bytes: byte [], byteIndex: int) : int
Encoding.GetBytes(chars: char []) : byte []
Encoding.GetBytes(chars: char [], index: int, count: int) : byte []
Encoding.GetBytes(chars: nativeptr<char>, charCount: int, bytes: nativeptr<byte>, byteCount: int) : int
Encoding.GetBytes(s: string, charIndex: int, charCount: int, bytes: byte [], byteIndex: int) : int
Encoding.GetBytes(chars: char [], charIndex: int, charCount: int, bytes: byte [], byteIndex: int) : int
System.String.ToUpperInvariant() : string
val res : int64 []
Full name: Tutorial.res
Full name: Tutorial.res
member SuffixArray.Search : query:byte [] -> int64 []