private static bool AllCharsHaveMatch(ReverseCodeTable rct, String str) { foreach (var c in str) { if (!rct.CharHasMatch(c)) { return(false); } } return(true); }
/// <summary> /// Constructs an instance with the specified input stream. /// /// Use this constructor to create an instance with a customized code table /// mapping. The mapping file should follow the structure of LC's XML MARC-8 /// to Unicode mapping (see: /// http://www.loc.gov/marc/specifications/codetables.xml). /// </summary> /// <param name="?"></param> public UnicodeToAnsel(Stream stream) { rct = new ReverseCodeTableHash(stream); }
/// <summary> /// Constructs an instance with the specified pathname. /// /// Use this constructor to create an instance with a customized code table /// mapping. The mapping file should follow the structure of LC's XML MARC-8 /// to Unicode mapping (see: /// http://www.loc.gov/marc/specifications/codetables.xml). /// </summary> /// <param name="pathname"></param> public UnicodeToAnsel(String pathname) { rct = new ReverseCodeTableHash(pathname); }
/// <summary> /// Creates a new instance and loads the MARC4J supplied Ansel/Unicode /// conversion tables based on the official LC tables. Loads in the generated class /// ReverseCodeTableGenerated which contains switch statements to lookup /// the MARC-8 encodings for given Unicode characters. /// </summary> public UnicodeToAnsel() { rct = LoadGeneratedTable(); //this(UnicodeToAnsel.class // .getResourceAsStream("resources/codetables.xml")); }