A few more SimpleVector changes.
CI / ubuntu-latest-html-tests (push) Has been cancelled
CI / ubuntu-latest-no-tls (push) Has been cancelled
CI / ubuntu-latest-mbedtls2 (push) Has been cancelled
CI / ubuntu-latest-openssl-3 (push) Has been cancelled
CI / ubuntu-latest-with-old-std (push) Has been cancelled
CI / ubuntu-20-04-openssl-1-1 (push) Has been cancelled
CI / alpine-mbedtls-3_6_0 (push) Has been cancelled
CI / macOS-13-openssl-1-1 (push) Has been cancelled
CI / macOS-13-openssl-3 (push) Has been cancelled
CI / freebsd-14-openssl-3 (push) Has been cancelled
CI / windows-mbedtls (push) Has been cancelled

This commit is contained in:
2025-08-11 02:30:11 -04:00
parent 214a4a62fe
commit fad69219ad
3 changed files with 17 additions and 20 deletions
+5 -6
View File
@@ -140,7 +140,7 @@ void Hyphenator::insertPattern (TrieBuilder *trieBuilder, char *s)
// Convert the a pattern like 'a1bc3d4' into a string of chars 'abcd'
// and a list of points [ 0, 1, 0, 3, 4 ].
std::string chars;
SimpleVector<char> points (1);
std::vector< char > points;
// TODO numbers consisting of multiple digits?
// TODO Encoding: This implementation works exactly like the Python
@@ -148,8 +148,7 @@ void Hyphenator::insertPattern (TrieBuilder *trieBuilder, char *s)
int numChars = 0;
for (int i = 0; s[i]; i++) {
if (s[i] >= '0' && s[i] <= '9') {
points.setSize(numChars + 1, '0');
points.set(numChars, s[i]);
points.push_back( s[ i ] );
} else {
numChars++;
chars+= s[i];
@@ -157,8 +156,8 @@ void Hyphenator::insertPattern (TrieBuilder *trieBuilder, char *s)
}
chars[numChars] = 0;
points.setSize(numChars + 2, '0');
points.set(numChars + 1, '\0');
points.resize( numChars + 2, '0' );
points.at( numChars + 1 )= '\0';
// Insert the pattern into the tree. Each character finds a dict
// another level down in the tree, and leaf nodes have the list of
@@ -166,7 +165,7 @@ void Hyphenator::insertPattern (TrieBuilder *trieBuilder, char *s)
//printf("insertPattern %s\n", chars);
trieBuilder->insert (chars.c_str(), points.getArray ());
trieBuilder->insert (chars.c_str(), points.data());
}
void Hyphenator::insertException (char *s)