CompEvol / BeastFX

GUIs for BEAST using Java FX to make things more pretty.
GNU Lesser General Public License v2.1
4 stars 1 forks source link

Guess date dialog #46

Closed walterxie closed 1 year ago

walterxie commented 1 year ago
  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));
    }