public class TextChecker extends Object
Modifier and Type | Method and Description |
---|---|
TextCheckResult |
checkAlt(String alt) |
TextCheckResult |
checkAlt(String alt,
Set<String> ngWords) |
TextCheckResult |
checkAlt(String alt,
String src) |
TextCheckResult |
checkAlt(String alt,
String src,
Set<String> ngWords)
Check alt attribute string and returns result in one of the constants
defined above.
|
int |
checkInappropriateAlt(String alt)
Check possibly inappropriate alternative text.
|
Set<String> |
getInappropriateALTSet()
Get inappropriate alternative text
Set |
static TextChecker |
getInstance()
Get instance of
TextChecker |
boolean |
isAsciiArtString(String str) |
boolean |
isInappropriateAlt(String alt)
Check appropriateness of alternative text.
|
boolean |
isRedundantText(String prevText,
String curText)
Check redundancy of text
|
boolean |
isSeparatedJapaneseChars(String target)
Check if the target String is space separated Japanese chars or not
|
void |
setInappropriateAltSet(Set<String> inappAltSet)
Set inappropriate alternative text
Set . |
public static TextChecker getInstance()
TextChecker
TextChecker
public boolean isRedundantText(String prevText, String curText)
prevText
- previous textcurText
- target text to checkpublic boolean isInappropriateAlt(String alt)
alt
- target alternative textSet
public int checkInappropriateAlt(String alt)
alt
- target alternative textpublic boolean isSeparatedJapaneseChars(String target)
target
- target Stringpublic Set<String> getInappropriateALTSet()
Set
Set
of inappropriate alternative textpublic void setInappropriateAltSet(Set<String> inappAltSet)
inappAltSet
- Set
of inappropriate alternative textpublic TextCheckResult checkAlt(String alt)
public TextCheckResult checkAlt(String alt, String src)
public TextCheckResult checkAlt(String alt, Set<String> ngWords)
public TextCheckResult checkAlt(String alt, String src, Set<String> ngWords)
alt
- The value of the alt attributes of images, buttons, area
elements, etc. It MUST NOT be null.src
- The value of the src attribute. Set null if it does not exist.ngWords
- additional NG words set; when we check ALT text of area
element, we want to add "area" as additional NG word.public boolean isAsciiArtString(String str)