19 package org.sleuthkit.autopsy.coreutils;
21 import java.awt.ComponentOrientation;
35 for (
char c : text.toCharArray()) {
36 if (Character.isWhitespace(c)) {
41 byte direction = Character.getDirectionality(c);
42 if (direction == Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC
43 || direction == Character.DIRECTIONALITY_RIGHT_TO_LEFT) {
48 ComponentOrientation orientation = ComponentOrientation.LEFT_TO_RIGHT;
49 if (text.length() > 1024 && rtl_cnt > 50) {
50 orientation = ComponentOrientation.RIGHT_TO_LEFT;
51 }
else if (text.length() <= 1024 && rtl_cnt > text.length() / 4) {
52 orientation = ComponentOrientation.RIGHT_TO_LEFT;
static ComponentOrientation getTextDirection(String text)