Created
October 10, 2019 12:54
-
-
Save GroupDocsGists/8fe7c13d4e392bf9af43d3255ef20749 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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