-
-
Save timothyandrew/8139eefcd58abe9ff6d5 to your computer and use it in GitHub Desktop.
Generate test cases for unicode normalizer
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
import java.text.Normalizer; | |
import java.util.Random; | |
import org.apache.lucene.util._TestUtil; | |
public class NormalizeTestGen { | |
public static void main(String[] args){ | |
String random = org.apache.lucene.util._TestUtil.randomRealisticUnicodeString(new Random()); | |
System.out.print("NFD.normalize(\""); | |
System.out.print(random); | |
System.out.print("\").should == \""); | |
System.out.print(Normalizer.normalize(random, Normalizer.Form.NFD)); | |
System.out.println("\""); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment