LUCENE-9053: improve FST's package-info.java comment to clarify required (Unicode code point) sort order for FST.Builder

This commit is contained in:
Mike McCandless 2020-01-17 13:35:05 -05:00
parent fb3ca8d000
commit 8147e491ce
1 changed files with 3 additions and 1 deletions

View File

@ -34,7 +34,9 @@
* <p> * <p>
* FST Construction example: * FST Construction example:
* <pre class="prettyprint"> * <pre class="prettyprint">
* // Input values (keys). These must be provided to Builder in Unicode sorted order! * // Input values (keys). These must be provided to Builder in Unicode code point (UTF8 or UTF32) sorted order.
* // Note that sorting by Java's String.compareTo, which is UTF16 sorted order, is not correct and can lead to
* // exceptions while building the FST:
* String inputValues[] = {"cat", "dog", "dogs"}; * String inputValues[] = {"cat", "dog", "dogs"};
* long outputValues[] = {5, 7, 12}; * long outputValues[] = {5, 7, 12};
* *