@@ -0,0 +1,2101 @@
+package cc.twittertools.words;%0A%0A//=================================================================================================%0A//Copyright 2011 Twitter, Inc.%0A//-------------------------------------------------------------------------------------------------%0A//Licensed under the Apache License, Version 2.0 (the %22License%22);%0A//you may not use this work except in compliance with the License.%0A//You may obtain a copy of the License in the LICENSE file, or at:%0A//%0A//http://www.apache.org/licenses/LICENSE-2.0%0A//%0A//Unless required by applicable law or agreed to in writing, software%0A//distributed under the License is distributed on an %22AS IS%22 BASIS,%0A//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A//See the License for the specific language governing permissions and%0A//limitations under the License.%0A//=================================================================================================%0A%0A//=================================================================================================%0A// Amended to handle the 'ts case, notably the phrase %22do's and don'ts%22, but also references to%0A// %22gov'ts%22 as an abbreviation for %22governement's%22.%0A//%0A// - Bryan Feeney%0A//=================================================================================================%0A%0Aimport java.util.regex.Pattern;%0A%0Aimport com.twitter.common.text.combiner.ExtractorBasedTokenCombiner;%0Aimport com.twitter.common.text.extractor.RegexExtractor;%0Aimport com.twitter.common.text.token.TokenStream;%0A%0A/**%0A* Combines multiple tokens denoting a possessive form (e.g., Twitter's) or%0A* a contraction form (e.g., isn't) back into a single token.%0A*/%0Apublic class MyPossessiveContractionTokenCombiner extends ExtractorBasedTokenCombiner %7B%0A%09private static final Pattern APOSTROPHE_S = Pattern.compile(%22(%5Ba-zA-Z%5D+'(?i:t%7Cts%7Cs%7Cm%7Cre%7Cve%7Cll%7Cd))(%5B%5Ea-zA-Z%5D%7C$)%22);%0A%0A%09public MyPossessiveContractionTokenCombiner(TokenStream inputStream) %7B%0A%09  super(inputStream);%0A%09  setExtractor(%0A%09%09%09new RegexExtractor%0A%09%09%09.Builder()%0A%09%09%09.setRegexPattern(APOSTROPHE_S, 1, 1)%0A%09    .setTriggeringChar('%5C'')%0A%09    .build()%0A%09  );%0A%09%7D%0A%7D%0A

Add support for better apostrophe-d abbrevations such as don'ts and gov'ts