CompEvol/BeastFX

Guess date dialog

walterxie opened this issue · 0 comments

  1. It looks the Guess date dialog does not have the feature to deal with 2-digit year anymore, see the screenshot from BEAST 1:

tipdates4

  1. It seems the delimiter is restricted to 1 char, which does not allow the string, such as the screenshot below:

Screenshot 2023-03-15 at 9 29 44 AM

The code is in normalise in GuessPatternDialog. Not sure why not to use Java split()?

    /**
     * Converts the first character of delimiter into a substring suitable for
     * inclusion in a regexp. This is done by expressing the character as an
     * octal escape.
     *
     * @param delimiter first character of this string to be used as delimiter
     * @return escaped octal representation of character
     */
    private String normalise(String delimiter) {

        if (delimiter.length() == 0) {
            return ".";
        }

        return String.format("\\0%o", (int)delimiter.charAt(0));
    }