}
public String parseFunction(List<String> list, IWikiModel model, char[] src, int beginIndex, int endIndex) {
if (list.size() > 0) {
String arg0 = parse(list.get(0), model);
INamespace namespace = model.getNamespace();
try {
int numberCode = Integer.valueOf(arg0).intValue();
if (numberCode >= (-2) || numberCode <= 15) {
return namespace.getNamespaceByNumber(numberCode);
}
} catch (NumberFormatException nfe) {
// the given argument could not be parsed as integer number
arg0 = arg0.replace(' ', '_');
String value = namespace.getNamespaceByLowercase(arg0.toLowerCase());
if (value != null) {
return value;
}
return "[[:Template:Ns:" + arg0 + "]]";
}