public UnknownDictionary(CharacterDefinitions characterDefinition, int[][] entries, int[][] costs, String[][] features, int totalFeatures) { this.characterDefinition = characterDefinition; this.entries = entries; this.costs = costs; this.features = features; this.totalFeatures = totalFeatures; }
public static CharacterDefinitions NewInstance(string resourceAbsolutePath) { try { using (Stream charDefInput = File.OpenRead(resourceAbsolutePath + Path.DirectorySeparatorChar + CHARACTER_DEFINITIONS_FILENAME)) using (BinaryReader reader = new BinaryReader(charDefInput)) { int[][] definitions = IntegerArrayIO.ReadSparseArray2D(reader); int[][] mappings = IntegerArrayIO.ReadSparseArray2D(reader); string[] symbols = StringArrayIO.ReadArray(reader); CharacterDefinitions characterDefinition = new CharacterDefinitions(definitions, mappings, symbols); return(characterDefinition); } } catch (IOException ex) { throw new IOException("CharacterDefinitions.NewInstance: " + ex.Message); } }
public static UnknownDictionary NewInstance(string absoluteFolderPath, CharacterDefinitions characterDefinitions, int totalFeatures) { string filePath = absoluteFolderPath + Path.DirectorySeparatorChar + UnknownDictionary.UNKNOWN_DICTIONARY_FILENAME; using (Stream unkDefInput = File.OpenRead(filePath)) using (BinaryReader reader = new BinaryReader(unkDefInput)) { int[][] costs = IntegerArrayIO.ReadArray2D(reader); int[][] references = IntegerArrayIO.ReadArray2D(reader); string[][] features = StringArrayIO.ReadArray2D(reader); UnknownDictionary unknownDictionary = new UnknownDictionary( characterDefinitions, references, costs, features, totalFeatures ); return(unknownDictionary); } }
public UnknownDictionary(CharacterDefinitions characterDefinition, int[][] entries, int[][] costs, String[][] features) : this(characterDefinition, entries, costs, features, features.Length) { }