UETsegmenter
UETsegmenter copied to clipboard
Code Review
Multiple meaningless null
checks
Example: https://github.com/phongnt570/UETsegmenter/blob/master/src/vn/edu/vnu/uet/nlp/tokenizer/Tokenizer.java#L25
s
can not be null. You already call s
before.
String[] tempTokens = s.split("(\\s| )+");
if (trimed.isEmpty() || trimed.equals(StringConst.SPACE) || s == null || tempTokens.length == 0) {
return tokens;
}
Thanks for your useful feedback. I am revising to clean the code.