Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
string indexFolder = @"c:\MyIndex";
string documentFolder = @"c:\MyDocuments";
// Creating index
Index index = new Index(indexFolder);
// Setting blended character type for Chinese characters
HashSet<char> hashSet = new HashSet<char>();
for (char character = (char)0x4E00; character <= 0x9FFF; character++) // Common
{
hashSet.Add(character);
}
for (char character = (char)0x3400; character <= 0x4DBF; character++) // Rare
{
hashSet.Add(character);
}
char[] characters = new char[hashSet.Count];
hashSet.CopyTo(characters);
index.Dictionaries.Alphabet.SetRange(characters, CharacterType.SeparateWord); // Setting character type
// Adding documents to index
index.Add(documentFolder);
// Searching for the Unicode character U+4E50
SearchResult result = index.Search("\u4E50");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.