MCPcopy Create free account
hub / github.com/BaseXdb/basex / noDiacritics

Method noDiacritics

basex-core/src/main/java/org/basex/util/FTToken.java:39–50  ·  view source on GitHub ↗

Returns a token without diacritics. @param token token to be normalized @return resulting token

(final byte[] token)

Source from the content-addressed store, hash-verified

37 * @return resulting token
38 */
39 public static byte[] noDiacritics(final byte[] token) {
40 final int tl = token.length;
41 final TokenBuilder tb = new TokenBuilder(tl);
42 Token.forEachCp(token, cp -> {
43 if(cp < 0x80) {
44 tb.add(cp);
45 } else if(!isCombining(Character.getType(cp))) {
46 tb.add(noDiacritics(cp));
47 }
48 });
49 return tb.finish();
50 }
51
52 /**
53 * Checks if a character is a letter or digit.

Callers 4

dbNameMethod · 0.80
getMethod · 0.80
nextTokenMethod · 0.80
normalizeMethod · 0.80

Calls 6

forEachCpMethod · 0.95
addMethod · 0.95
isCombiningMethod · 0.95
finishMethod · 0.95
getMethod · 0.65
getTypeMethod · 0.45

Tested by

no test coverage detected