Add per-top findMinWidth etc for NFA graphs

This commit is contained in:
Justin Viiret
2015-12-02 18:16:49 +11:00
committed by Matthew Barr
parent 748d46c124
commit 8c09d054c9
3 changed files with 75 additions and 27 deletions

View File

@@ -910,9 +910,8 @@ 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());
return findMinWidth(*s.graph(), top);
} else if (s.castle()) {
return findMinWidth(*s.castle(), top);
} else {
@@ -933,9 +932,8 @@ 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());
return findMaxWidth(*s.graph(), top);
} else if (s.castle()) {
return findMaxWidth(*s.castle(), top);
} else {