mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-19 02:30:35 +03:00
findMinWidth, findMaxWidth: width for a given top
Currently only implemented for Castle suffixes.
This commit is contained in:
committed by
Matthew Barr
parent
03953f34b1
commit
8dac64d1dc
@@ -907,6 +907,18 @@ depth findMinWidth(const suffix_id &s) {
|
||||
}
|
||||
}
|
||||
|
||||
depth findMinWidth(const suffix_id &s, u32 top) {
|
||||
assert(s.graph() || s.castle() || s.haig() || s.dfa());
|
||||
// TODO: take top into account for non-castle suffixes.
|
||||
if (s.graph()) {
|
||||
return findMinWidth(*s.graph());
|
||||
} else if (s.castle()) {
|
||||
return findMinWidth(*s.castle(), top);
|
||||
} else {
|
||||
return s.dfa_min_width;
|
||||
}
|
||||
}
|
||||
|
||||
depth findMaxWidth(const suffix_id &s) {
|
||||
assert(s.graph() || s.castle() || s.haig() || s.dfa());
|
||||
if (s.graph()) {
|
||||
@@ -918,6 +930,18 @@ depth findMaxWidth(const suffix_id &s) {
|
||||
}
|
||||
}
|
||||
|
||||
depth findMaxWidth(const suffix_id &s, u32 top) {
|
||||
assert(s.graph() || s.castle() || s.haig() || s.dfa());
|
||||
// TODO: take top into account for non-castle suffixes.
|
||||
if (s.graph()) {
|
||||
return findMaxWidth(*s.graph());
|
||||
} else if (s.castle()) {
|
||||
return findMaxWidth(*s.castle(), top);
|
||||
} else {
|
||||
return s.dfa_max_width;
|
||||
}
|
||||
}
|
||||
|
||||
bool has_eod_accepts(const suffix_id &s) {
|
||||
assert(s.graph() || s.castle() || s.haig() || s.dfa());
|
||||
if (s.graph()) {
|
||||
|
||||
Reference in New Issue
Block a user