@@ -0,0 +1,1538 @@
+package com.joliciel.talismane.tokeniser.filters;%0A%0Aimport java.util.Set;%0Aimport java.util.regex.Pattern;%0A%0Aimport com.joliciel.talismane.TalismaneSession;%0Aimport com.joliciel.talismane.tokeniser.Token;%0Aimport com.joliciel.talismane.tokeniser.TokenSequence;%0A%0A/**%0A * Systematically lowercase the first alphabetic word of a sentence, unless it%0A * is in all caps.%0A */%0Apublic class LowercaseFirstWordFilter implements TokenFilter %7B%0A  private final TalismaneSession session;%0A%0A  private static final Pattern alphaPattern = Pattern.compile(%22%5C%5Cp%7BL%7D.*%22, Pattern.UNICODE_CHARACTER_CLASS);%0A  private static final Pattern punctuation = Pattern.compile(%22%5B:;%5D%22, Pattern.UNICODE_CHARACTER_CLASS);%0A%0A  public LowercaseFirstWordFilter(TalismaneSession session) %7B%0A    this.session = session;%0A  %7D%0A%0A  @Override%0A  public void apply(TokenSequence tokenSequence) %7B%0A    boolean lowerNextWord = true;%0A    for (Token token : tokenSequence) %7B%0A      String word = token.getText();%0A      if (lowerNextWord && alphaPattern.matcher(word).matches()) %7B%0A        if (Character.isUpperCase(word.charAt(0)) && (word.length() == 1 %7C%7C !word.equals(word.toUpperCase()))) %7B%0A          Set%3CString%3E possibleWords = session.getDiacriticizer().diacriticize(word);%0A          if (possibleWords.size() %3E 0)%0A            token.setText(possibleWords.iterator().next());%0A          else%0A            token.setText(word.toLowerCase());%0A        %7D%0A        lowerNextWord = false;%0A      %7D else if (punctuation.matcher(word).matches()) %7B%0A        lowerNextWord = true;%0A      %7D%0A    %7D // next token%0A  %7D%0A%7D%0A

Add lowercase first word filter