bahamut/tools/text-encoder.hpp
//returns an index into the name table if text is a valid name; or nothing otherwise
returns an index into the name table if text is a valid name; or nothing otherwise
returns an index into the name table if text is a valid name ; or nothing otherwise
auto TextEncoder::name(const string& text) -> maybe<u32> {
  static vector<string> names;
  if(!names) names = string::read({pathEN, "scripts/lists/names.txt"}).split("\n");
  return names.find(text);
}
auto TextEncoder :: name ( const string & text ) -> maybe < u32 > { static vector < string > names ; if ( ! names ) names = string :: read ( { pathEN , " " } ) . split ( " \n " ) ; return names . find ( text ) ; }
returns an index into the name table if text is a valid name; or nothing otherwise
returns an index into the name table if text is a valid name ; or nothing otherwise