// Replaces all the spaces in term names with another character (underscore by default) // unescapes backslash escape characters in a string function unescape(str) { out = ""; for(i=0; i < str.length(); i++) { c = str.substring(i,i+1); if (c.equals("\")) { i++; c = str.substring(i,i+1); } out = out+c; } return out; } // optionally reads a spacing character from the command-line // (if one isn't specified, uses "_") if (args.size() > 0) replaceChar = unescape(args.get(0)); else replaceChar = "_"; // replace spaces in the term names with the replacement character foreach (term in session.getObjects()) { term.setName(term.getName().replaceAll(" ",replaceChar)); }