return null;
}
// language code only
int pos = value.indexOf('_');
if (pos == -1) {
return new HyphenationAuto(value, null, 2, 2);
}
// language and country code
String lang = value.substring(0, pos);
String country = value.substring(pos + 1);
// no leftMin or rightMin
pos = country.indexOf(',');
if (pos == -1) {
return new HyphenationAuto(lang, country, 2, 2);
}
// leftMin and rightMin value
int leftMin;
int rightMin = 2;
value = country.substring(pos + 1);
country = country.substring(0, pos);
pos = value.indexOf(',');
if (pos == -1) {
leftMin = Integer.parseInt(value);
} else {
leftMin = Integer.parseInt(value.substring(0, pos));
rightMin = Integer.parseInt(value.substring(pos + 1));
}
return new HyphenationAuto(lang, country, leftMin, rightMin);
}