1
1
mirror of https://github.com/MarginaliaSearch/MarginaliaSearch.git synced 2025-10-05 21:22:39 +02:00

(language) Add support for downloadable resources, parsing POS tag configuration tags

This commit is contained in:
Viktor Lofgren
2025-08-20 12:09:27 +02:00
parent f682425594
commit 507c09146a
8 changed files with 378 additions and 66 deletions

View File

@@ -57,12 +57,20 @@ public class MurmurHash3_128 {
return hash64(data, 0, data.length(), data.hashCode());
}
/** Like hashASCIIOnly except seeded with the Java String.hashCode()
* to provide better behavior for non-ASCII strings. It's much worse
* than doing it properly, but better than not doing this.
*/
public long hashUtf8(String data) {
return hash64(data, 0, data.length(), DEFAULT_SEED);
}
/** Select the hash function appropriate for keywords based system configuration,
* and hash the keyword.
*/
public long hashKeyword(String data) {
if (NO_FLATTEN_UNICODE) {
return hash64(data, 0, data.length(), DEFAULT_SEED);
return hashUtf8(data);
}
else {
return hashNearlyASCII(data);