コード例 #1
0
        public void TestSeparatorInLookupTerm()
        {
            FSA fsa = FSA.Read(GetType().getResourceAsStream("test-separator-in-lookup.fsa"));

            DictionaryMetadata metadata = new DictionaryMetadataBuilder()
                                          .Separator('+')
                                          .Encoding("iso8859-1")
                                          .Encoder(EncoderType.Infix)
                                          .Build();

            DictionaryLookup s = new DictionaryLookup(new Dictionary(fsa, metadata));

            assertEquals(0, s.Lookup("l+A").Count);
        }
コード例 #2
0
 /// <summary>
 /// Attempts to load a dictionary from opened streams of FSA dictionary data
 /// and associated metadata. Input streams are not disposed automatically.
 /// </summary>
 /// <param name="fsaStream">The stream with FSA data.</param>
 /// <param name="metadataStream">The stream with metadata.</param>
 /// <returns>Returns an instantiated <see cref="Dictionary"/>.</returns>
 /// <exception cref="IOException">IOException if an I/O error occurs.</exception>
 public static Dictionary Read(Stream fsaStream, Stream metadataStream)
 {
     return(new Dictionary(FSA.Read(fsaStream), DictionaryMetadata.Read(metadataStream)));
 }