-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bump JSP to Unicode 14 #93
Conversation
7477414
to
0602af8
Compare
blocked by and based on. #44 |
Step 1a text files For #88 - GenerateSubtagNames - Extra{Property,PropertyValue}Aliases.txt - PropertyAliases.txt from 14.0.0 - copied props with CopyPropsToUnicodeJsp
- leave some space between ICU and collections such as Hans - replace some synchornized and static init with Bill Pugh singletons for #88
0602af8
to
a3cf705
Compare
- updated docs For: #88
73f1434
to
c9461c5
Compare
@@ -44,7 +44,7 @@ | |||
final BiMultimap<String,String> nameToAliases = new BiMultimap<String,String>(null,null); | |||
final Map<String,BiMultimap<String,String>> nameToValueToAliases = new LinkedHashMap(); | |||
|
|||
static CachedProps CACHED_PROPS = getInstance(VersionInfo.getInstance(12)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised at this; if based on master it would be replacing 13 by 14.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a bug? I hadn't changed this value. Should it be calculated ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lemme check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that should be the version of the beta props. I think it is built that way so that it doesn't pull in the BIN properties if BETA is off. For now, let's just leave it at 14, but file an issue.
* @param version | ||
* @return | ||
*/ | ||
public String versionToString(VersionInfo version) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a method on VersionInfo that produces a string with specified fields. Should be used instead of string building. Could be fixed later if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw that but it is ICU @Internal
and has its own behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use it in a bunch of places, and frankly there isn't a good reason for it not to be public. Mark
But this isn't a blocker at all!!
We use it in a bunch of places, and frankly there isn't a good reason for
it not to be public.
Mark
…On Tue, Jul 20, 2021 at 3:14 PM Steven R. Loomis ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In unicodetools/org/unicode/text/utility/Settings.java
<#93 (comment)>
:
> + */
+ public Path asPath(VersionInfo forVersion) {
+ String versionString = versionToString(forVersion);
+ if (this == ucd) {
+ // For some reason, these have -Update
+ return asPath().resolve(versionString + "-Update");
+ } else {
+ return asPath().resolve(versionString);
+ }
+ }
+ /**
+ * Map a version number to a string.
+ * @param version
+ * @return
+ */
+ public String versionToString(VersionInfo version) {
I saw that but it is ICU @internal and has its own behavior.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#93 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACJLEMCIZMTDZQUUEBHGMKDTYXYLLANCNFSM5AHOVP2A>
.
|
@@ -44,7 +44,7 @@ | |||
final BiMultimap<String,String> nameToAliases = new BiMultimap<String,String>(null,null); | |||
final Map<String,BiMultimap<String,String>> nameToValueToAliases = new LinkedHashMap(); | |||
|
|||
static CachedProps CACHED_PROPS = getInstance(VersionInfo.getInstance(12)); | |||
static CachedProps CACHED_PROPS = getInstance(VersionInfo.getInstance(14)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be driven by the version string in class Settings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit more complicated than that because of the interplay with the beta flag. I suggested that we go with 14 for now, and file an issue. We don't want to wait on the fuller solution.
@@ -9,6 +9,10 @@ | |||
import java.util.Set; | |||
import java.util.TreeMap; | |||
import java.util.TreeSet; | |||
import java.util.Map.Entry; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that Eclipse is dumb about this, but it would be much better to only import Map, and use Map.Entry
in call sites.
// Verify we didn't run over | ||
if (newCode >= LIMIT) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a hard limit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we have more than 'extrascripts' scripts, yes
// Scripts without stable numbers | ||
{"Hant", "Han Traditional"}, {"Hans", "Han Simplified"}, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need these? ICU has UScript.SIMPLIFIED_HAN and UScript.TRADITIONAL_HAN.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure.
LIMIT = UScript.CODE_LIMIT; // HANS + 1; | ||
|
||
private static String[][] EXTENDED_NAME = {{"Hant", "Han Traditional"}, {"Hans", "Han Simplified"}}; | ||
LIMIT = UScript.CODE_LIMIT + EXTRA_COUNT; // HANS + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the comments about HANT/HANS -- since we have real UScript constants for them.
docs/unicodejsps/index.md
Outdated
@@ -1,4 +1,4 @@ | |||
# Building UnicodeJsp | |||
git # Building UnicodeJsp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
String fromDir = Settings.Output.BIN_DIR + latest.getUcdVersion() + "/"; | ||
VersionInfo ucdVersion = latest.getUcdVersion(); | ||
System.out.println("Copying Props for " + ucdVersion + " into JSP"); | ||
String fromDir = Settings.Output.BIN_DIR + ucdVersion + "/"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no tabs please
@@ -27,7 +28,8 @@ | |||
|
|||
public class ListProps { | |||
|
|||
private static final UcdProperty DEBUG_LIST_VALUES = null ; // UcdProperty.Confusable_MA; | |||
private static final String BIN_PROPS = Settings.Output.BIN_DIR; | |||
private static final UcdProperty DEBUG_LIST_VALUES = null ; // UcdProperty.Confusable_MA; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tab
if (this != emoji) { | ||
// 13.1, 14.0 | ||
sb.append(".") | ||
.append(version.getMicro()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getMicro() --> getMilli()
or indeed better call internal-for-CLDR-etc getVersionString()
public static final String UCD_DIR = DATA_DIR + "ucd/"; | ||
// TODO: IDN_DIR is used, but there is no .../data/IDN/ folder. Should this be .../data/idna/ ? | ||
public static final String IDN_DIR = DATA_DIR + "IDN/"; | ||
// TODO: DICT_DIR is used, but there is no .../data/dict/ folder. ?? | ||
public static final String DICT_DIR = DATA_DIR + "dict/"; | ||
|
||
public enum DataDir { | ||
security, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enum constants should be uppercase
@@ -70,11 +76,58 @@ private static final String getRequiredPathAndFix(String key) { | |||
public static final String UNICODETOOLS_DIR = UNICODETOOLS_REPO_DIR + "unicodetools/"; | |||
public static final String UNICODEJSPS_DIR = UNICODETOOLS_REPO_DIR + "UnicodeJsps/"; | |||
public static final String DATA_DIR = UNICODETOOLS_DIR + "data/"; | |||
public static final Path DATA_FILE = Paths.get(DATA_DIR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private?
} | ||
|
||
public static void main(String args[]) throws IOException { | ||
generateSubtagNames(); // this takes a sec, so run it first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent 4 please
7e5bf75
to
01eed8b
Compare
- typo/tab fixes - add a unit test for Settings.UnicodeTools.DataDir - Apply other suggestions from code review Co-authored-by: Markus Scherer <markus.icu@gmail.com>
8ffe009
to
933d2b8
Compare
OK, please take a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go for it!
Fixes: #88
see diary here: https://gist.github.com/srl295/a788b4de315cd919bb5f0f4e3b2f69c7 (search for 'SRL')
also:
Fixes #103