felipelouza / gsa-is Goto Github PK
View Code? Open in Web Editor NEWInducing enhanced suffix arrays for string collections [DCC'16, TCS 2017]
Home Page: https://doi.org/10.1016/j.tcs.2017.03.039
License: MIT License
Inducing enhanced suffix arrays for string collections [DCC'16, TCS 2017]
Home Page: https://doi.org/10.1016/j.tcs.2017.03.039
License: MIT License
I need to build a suffix array on multi-character tokens (basically 'words') rather than characters. In my first attempt I created a sorted 'alphabet' of unique tokens from the input, and assigned each an integer, then passed the string of these integer indexes, joined with a separator into the algorithm. This works, but require lots of string joins/splits, and there are additional suffixes computed that start with the separator which is not ideal.
I'm wondering if there a better way to do this, perhaps computing the SA directly on the array rather than on a string ??
A toy example given the input array [ "if", "it", "is", "true", "it", "is", "true"]
.
[
0: if it is true it is true
1: is true
2: is true it is true
3: it is true
4: it is true it is true
5: true
6: true it is true
]
moved from: felipelouza/gsufsort#5
Implementation causes a segmentation fault when the input contains at least one empty string.
In your notation a$b$$d$#
.
Suffixes should be sorted as usual + the document index in DA, empty-suffix pointer in SA and a 0 in the LCP array.
I reckon:
i SA DA LCP suffixes
0 8 4 0 #
1 1 0 0 $b$$d$#
2 3 1 0 $$d$#
3 4 2 0 $d$#
4 6 3 0 $#
5 0 0 0 a$b$$d$#
6 2 1 0 b$$d$#
7 5 3 0 d$#
Segmentation fault.
Add a dummy token to all empty strings.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.