You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by tw...@apache.org on 2007/11/22 18:27:30 UTC
svn commit: r597458 [2/3] - in /incubator/uima/sandbox/trunk/BSFAnnotator:
./ desc/ lib/ src/ src/main/ src/main/java/ src/main/java/org/
src/main/java/org/apache/ src/main/java/org/apache/uima/
src/main/java/org/apache/uima/annotator/ src/main/java/or...
Added: incubator/uima/sandbox/trunk/BSFAnnotator/desc/NICKNAMES.bsh
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/desc/NICKNAMES.bsh?rev=597458&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/BSFAnnotator/desc/NICKNAMES.bsh (added)
+++ incubator/uima/sandbox/trunk/BSFAnnotator/desc/NICKNAMES.bsh Thu Nov 22 09:27:22 2007
@@ -0,0 +1,479 @@
+/**
+ * Example of beanshell script to be used as input for the
+ * BSFAnnotator
+ * @author Olivier Terrier
+ * @version 1.0
+ */
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.regex.Pattern;
+
+import org.apache.uima.analysis_engine.ResultSpecification;
+import org.apache.uima.analysis_engine.annotator.AnnotatorConfigurationException;
+import org.apache.uima.analysis_engine.annotator.AnnotatorContext;
+import org.apache.uima.analysis_engine.annotator.AnnotatorInitializationException;
+import org.apache.uima.analysis_engine.annotator.AnnotatorProcessException;
+import org.apache.uima.analysis_engine.annotator.JTextAnnotator_ImplBase;
+import org.apache.uima.annotator.bsf.types.Firstname;
+import org.apache.uima.annotator.bsf.types.Nickname;
+import org.apache.uima.annotator.bsf.types.Token;
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.jcas.cas.StringArray;
+import org.apache.uima.jcas.tcas.Annotation;
+ /**
+ * Initialisation of global variables
+ */
+ String scriptName;
+ HashMap nicknames;
+
+ /**
+ * Invokes this annotator's analysis logic. This annotator will access the
+ * data in the JCas and add new data to the JCas.
+ *
+ * @param jcas
+ * contains the document to be analyzed and may contain other
+ * metadata about that document.
+ * @param rs
+ * a list of output types and features that this annotator should
+ * produce.
+ */
+ public void process(JCas jcas, ResultSpecification rs)
+ throws AnnotatorProcessException {
+ // iterates on the existing token that have been created by the previous
+ // annotators
+ ArrayList annots = new ArrayList();
+ ArrayList tokens = new ArrayList();
+ Iterator tokenIt = jcas.getAnnotationIndex(Token.type).iterator();
+ while (tokenIt.hasNext()) {
+ Token token = (Token)tokenIt.next();
+ tokens.add(token);
+ String name = token.getCoveredText();
+ if (nicknames.containsKey(name)) {
+ ArrayList names = (ArrayList)nicknames.get(name);
+ // is it a real firstname ?
+ if (names.isEmpty()) {
+ Firstname annot = new Firstname(jcas, token.getStart(), token.getEnd());
+ annots.add(annot);
+ } else { // it's a nickname
+ Nickname annot = new Nickname(jcas, token.getStart(), token.getEnd());
+ StringArray strarray = new StringArray(jcas, names.size());
+ for (int i=0; i < names.size(); i++) {
+ strarray.set(i, (String)names.get(i));
+ }
+ annot.setFirstnames(strarray);
+ annots.add(annot);
+ }
+ }
+ }
+ for (Iterator it = annots.iterator(); it.hasNext();) {
+ ((Annotation)it.next()).addToIndexes();
+ }
+ for (Iterator it = tokens.iterator(); it.hasNext();) {
+ ((Annotation)it.next()).removeFromIndexes();
+ }
+ }
+
+ /**
+ * Performs any startup tasks required by this annotator. The Analysis
+ * Engine calls this method only once, just after an Annotator has been
+ * instantiated.
+ *
+ * @param aContext
+ * Provides access to external resources that may be used by this
+ * annotator. This includes configuration parameters, logging and
+ * instrumentation services, and access to external analysis
+ * resources.
+ * @see com.ibm.uima.analysis_engine.annotator.BaseAnnotator#initialize(com.ibm.uima.analysis_engine.annotator.AnnotatorContext)
+ */
+ public void initialize(AnnotatorContext aContext)
+ throws AnnotatorInitializationException,
+ AnnotatorConfigurationException {
+ // List of Firstnames => Nickname
+ String[] name_list = { "Aaron,Erin", "Aaron,Ron",
+ "Aaron,Ronnie", "Abel,Ab", "Abel,Abe", "Abel,Eb", "Abel,Ebbie",
+ "Abiel,Ab", "Abigail,Abby", "Abigail,Gail", "Abigail,Nabby",
+ "Abner,Ab", "Abraham,Ab", "Abraham,Abe", "Abram,Ab",
+ "Adaline,Ada", "Adaline,Addy", "Adaline,Delia", "Adaline,Dell",
+ "Adaline,Lena", "Adelaide,Addy", "Adelaide,Adele",
+ "Adelaide,Dell", "Adelaide,Della", "Adelaide,Heidi",
+ "Adeline,Ada", "Adeline,Addy", "Adeline,Delia", "Adeline,Dell",
+ "Adeline,Lena", "Adelphia,Addy", "Adelphia,Adele",
+ "Adelphia,Dell", "Adelphia,Delphia", "Adelphia,Philly",
+ "Agatha,Aggy", "Agnes,Aggy", "Agnes,Inez", "Agnes,Nessa",
+ "Aileen,Allie", "Aileen,Lena", "Alan,Al", "Albert,Al",
+ "Albert,Bert", "Alberta,Allie", "Alberta,Bert",
+ "Alberta,Bertie", "Aldo,Al", "Aldrich,Rich", "Aldrich,Riche",
+ "Alexander,Al", "Alexander,Alex", "Alexander,Sandy",
+ "Alexandra,Alex", "Alexandra,Alla", "Alexandra,Sandra",
+ "Alexandra,Sandy", "Alfonse,Al", "Alfred,Al", "Alfred,Fred",
+ "Alfred,Freddy", "Alfreda,Alfy", "Alfreda,Freda",
+ "Alfreda,Freddy", "Alfreda,Frieda", "Alice,Allie",
+ "Alice,Elsie", "Alice,Lisa", "Alicia,Allie", "Alicia,Elsie",
+ "Alicia,Lisa", "Allan,Al", "Allen,Al", "Allisandra,Allie",
+ "Almena,Allie", "Almena,Mena", "Alonzo,Al", "Alonzo,Lon",
+ "Alonzo,Lonzo", "Amanda,Manda", "Amanda,Mandy", "Amelia,Amy",
+ "Amelia,Emily", "Amelia,Mel", "Amelia,Millie", "Anderson,Andy",
+ "Andrew,Andy", "Andrew,Drew", "Ann,Annie", "Ann,Nan",
+ "Ann,Nana", "Ann,Nancy", "Ann,Nanny", "Anne,Annie", "Anne,Nan",
+ "Anne,Nana", "Anne,Nancy", "Anne,Nanny", "Anthony,Tony",
+ "Antoinette,Ann", "Antoinette,Netta", "Antoinette,Tony",
+ "Antonia,Ann", "Antonia,Netta", "Antonia,Tony", "Arabella,Ara",
+ "Arabella,Arry", "Arabella,Bella", "Arabella,Belle",
+ "Arabelle,Ara", "Arabelle,Arry", "Arabelle,Bella",
+ "Arabelle,Belle", "Archibald,Archie", "Arlene,Arly",
+ "Arlene,Lena", "Armena,Arry", "Armena,Mena", "Arthur,Art",
+ "Asahel,Asa", "Asaph,Asa", "Asenath,Assene", "Asenath,Natty",
+ "Asenath,Sene", "August,Gus", "Augusta,Aggy", "Augusta,Gatsy",
+ "Augusta,Gussie", "Augusta,Tina", "Augustina,Aggy",
+ "Augustina,Gatsy", "Augustina,Gussie", "Augustina,Tina",
+ "Augustine,August", "Augustine,Austin", "Augustine,Gus",
+ "Augustus,August", "Augustus,Austin", "Augustus,Gus",
+ "Azariah,Aze", "Azariah,Riah", "Barbara,Bab", "Barbara,Babs",
+ "Barbara,Barby", "Barbara,Bobbie", "Barnabas,Barney",
+ "Bartholomew,Bart", "Bartholomew,Bartel", "Bartholomew,Bat",
+ "Bartholomew,Mees", "Bartholomew,Meus", "Beatrice,Bea",
+ "Beatrice,Trisha", "Beatrice,Trix", "Beatrice,Trixie",
+ "Belinda,Belle", "Belinda,Linda", "Benedict,Ben",
+ "Benedict,Bennie", "Benjamin,Ben", "Benjamin,Benjy",
+ "Benjamin,Bennie", "Benjamin,Jamie", "Bernard,Barney",
+ "Bernard,Berney", "Bernard,Bernie", "Bertha,Bert",
+ "Bertha,Bertie", "Bertha,Birdie", "Bill,Fred", "Billy,Fred",
+ "Bradford,Brad", "Bradford,Ford", "Bridget,Biddie",
+ "Bridget,Biddy", "Bridget,Bridgie", "Bridget,Bridie",
+ "Broderick,Brady", "Broderick,Brody", "Broderick,Rick",
+ "Broderick,Ricky", "Calvin,Cal", "Calvin,Vin", "Calvin,Vinny",
+ "Cameron,Cam", "Cameron,Ron", "Cameron,Ronny",
+ "Camille,Cammie", "Camille,Millie", "Carol,Carrie",
+ "Carol,Cassie", "Carol,Lynn", "CarolAnn,Carol",
+ "CarolAnn,Carole", "Caroline,Carol", "Caroline,Carole",
+ "Caroline,Carrie", "Caroline,Cassie", "Caroline,Lynn",
+ "Carolyn,Carrie", "Carolyn,Cassie", "Carolyn,Lynn",
+ "Casey,K.C.", "Cassandra,Cassie", "Cassandra,Sandra",
+ "Cassandra,Sandy", "Catherine,Cassie", "Catherine,Cathy",
+ "Catherine,Kathy", "Catherine,Katy", "Catherine,Kay",
+ "Catherine,Kit", "Catherine,Kittie", "Catherine,Lena",
+ "Catherine,Trina", "Cathleen,Cassie", "Cathleen,Cathy",
+ "Cathleen,Kathy", "Cathleen,Katy", "Cathleen,Kay",
+ "Cathleen,Kit", "Cathleen,Kittie", "Cathleen,Lena",
+ "Cathleen,Trina", "Cecilia,Celia", "Cecilia,Cissy",
+ "Cedric,Ced", "Cedric,Rick", "Cedric,Ricky", "Charles,Carl",
+ "Charles,Charlie", "Charles,Chick", "Charles,Chuck",
+ "Charlotte,Char", "Charlotte,Lotta", "Charlotte,Lottie",
+ "Charlotte,Sherry", "Chauncey,Chan", "Chester,Chet",
+ "Christa,Chris", "Christian,Chris", "Christian,Kit",
+ "Christiana,Ann", "Christiana,Chris", "Christiana,Christy",
+ "Christiana,Crissy", "Christiana,Kris", "Christiana,Kristy",
+ "Christiana,Tina", "Christina,Chris", "Christina,Christy",
+ "Christina,Crissy", "Christina,Kris", "Christina,Kristy",
+ "Christina,Tina", "Christine,Chris", "Christine,Chrissy",
+ "Christine,Crissy", "Christine,Kris", "Christine,Kristy",
+ "Christine,Tina", "Christopher,Chris", "Christopher,Kit",
+ "Clarence,Clair", "Clarence,Clare", "Clarinda,Clara",
+ "Clarissa,Cissy", "Clarissa,Clara", "Clement,Clem",
+ "Clifford,Cliff", "Clifford,Ford", "Clifton,Cliff",
+ "Clifton,Tony", "Columbus,Clum", "Conrad,Con", "Conrad,Conny",
+ "Constance,Connie", "Cordelia,Cordy", "Cordelia,Delia",
+ "Cornelia,Cornie", "Cornelia,Corny", "Cornelia,Nelia",
+ "Cornelia,Nelle", "Cornelia,Nelly", "Cornelius,Con",
+ "Cornelius,Conny", "Cornelius,Corny", "Cornelius,Niel",
+ "Courtney,Court", "Courtney,Curt", "Curtis,Curt",
+ "Cynthia,Cindy", "Cynthia,Cintha", "Cyrenius,Cene",
+ "Cyrenius,Cy", "Cyrenius,Renius", "Cyrenius,Serene",
+ "Cyrenius,Swene", "Dal,Dahl", "Dalton,Dahl", "Daniel,Dan",
+ "Daniel,Danny", "Darlene,Darry", "Darlene,Lena", "David,Dave",
+ "David,Davey", "David,Day", "Debora,Deb", "Debora,Debbie",
+ "Debora,Debby", "Deborah,Deb", "Deborah,Debbie",
+ "Deborah,Debby", "Debra,Deb", "Debra,Debbie", "Delbert,Bert",
+ "Delbert,Del", "Deliverance,Della", "Deliverance,Delly",
+ "Deliverance,Dilly", "Delores,Dee", "Delores,Dell",
+ "Delores,Della", "Delores,Lola", "Delores,Lolly",
+ "Dennis,Denny", "Dennison,Denny", "Derrick,Eric",
+ "Derrick,Rick", "Derrick,Ricky", "Dicey,Dicie", "Domenic,Dom",
+ "Dominic,Dom", "Donald,Don", "Donald,Donnie", "Donald,Donny",
+ "Donald,Dony", "Dorcus,Darkey", "Dorothy,Dolly",
+ "Dorothy,Dortha", "Dorothy,Dot", "Dorothy,Dotty",
+ "Ebenezer,Eb", "Ebenezer,Ebbie", "Ebenezer,Eben", "Edgar,Ed",
+ "Edgar,Eddie", "Edgar,Eddy", "Edith,Edie", "Edith,Edye",
+ "Edmond,Ed", "Edmond,Eddie", "Edmond,Eddy", "Edmund,Ed",
+ "Edmund,Eddie", "Edmund,Eddy", "Edmund,Ned", "Edmund,Ted",
+ "Eduardo,Ed", "Eduardo,Eddie", "Eduardo,Eddy", "Edward,Ed",
+ "Edward,Eddie", "Edward,Eddy", "Edward,Ned", "Edward,Ted",
+ "Edward,Teddy", "Edwin,Ed", "Edwin,Eddie", "Edwin,Eddy",
+ "Edwin,Ned", "Edwin,Win", "Edyth,Edie", "Edyth,Edye",
+ "Edythe,Edie", "Edythe,Edye", "Elbert,Albert",
+ "Eleanor,Elaine", "Eleanor,Ellen", "Eleanor,Ellie",
+ "Eleanor,Lanna", "Eleanor,Lenora", "Eleanor,Nelly",
+ "Eleanor,Nora", "Eleazer,Lazar", "Elias,Eli", "Elias,Lee",
+ "Elias,Lias", "Elijah,Eli", "Elijah,Lige", "Eliphalet,Left",
+ "Elisha,Eli", "Elisha,Lish", "Elizabeth,Bess",
+ "Elizabeth,Bessie", "Elizabeth,Beth", "Elizabeth,Betsy",
+ "Elizabeth,Betty", "Elizabeth,Eliza", "Elizabeth,Lib",
+ "Elizabeth,Libby", "Elizabeth,Lisa", "Elizabeth,Liz",
+ "Elizabeth,Liza", "Elizabeth,Lizzie", "Ellswood,Elsey",
+ "Elmira,Ellie", "Elmira,Elly", "Elmira,Mira", "Elouise,Louise",
+ "Elsie,Elsey", "Elswood,Elsey", "Elwood,Woody", "Elze,Elsey",
+ "Emanuel,Manny", "Emanuel,Manuel", "Emeline,Em",
+ "Emeline,Emily", "Emeline,Emma", "Emeline,Emmy",
+ "Emeline,Milly", "Emily,Emma", "Emily,Emmy", "Emily,Millie",
+ "Epaphroditius,Dite", "Epaphroditius,Ditus",
+ "Epaphroditius,Dyce", "Epaphroditius,Dyche",
+ "Epaphroditius,Eppa", "Ephraim,Eph", "Eric,Rick", "Eric,Ricky",
+ "Ernest,Ernie", "Estella,Essy", "Estella,Stella",
+ "Estelle,Essy", "Estelle,Stella", "Eugene,Gene", "Evaline,Eva",
+ "Evaline,Eve", "Evaline,Lena", "Ezekiel,Ez", "Ezekiel,Zeke",
+ "Ezra,Ez", "Faith,Fay", "Feltie,Felty", "Ferdinand,Ferdie",
+ "Ferdinand,Fred", "Ferdinand,Freddie", "Ferdinand,Freddy",
+ "Fidelia,Delia", "Florence,Flo", "Florence,Flora",
+ "Florence,Flossy", "Frances,Cissy", "Frances,Fanny",
+ "Frances,Fran", "Frances,Francie", "Frances,Frankie",
+ "Frances,Frannie", "Frances,Franniey", "Frances,Sis",
+ "Francine,Fran", "Francine,Francie", "Francine,Frannie",
+ "Francine,Franniey", "Francis,Fran", "Francis,Frank",
+ "Francis,Frankie", "Franklin,Fran", "Franklin,Frank",
+ "Franklind,Frank", "Frederick,Fred", "Frederick,Freddie",
+ "Frederick,Freddy", "Frederick,Fritz", "Fredericka,Freda",
+ "Fredericka,Freddy", "Fredericka,Frieda", "Fredericka,Ricka",
+ "Frieda,Fred", "Frieda,Freddie", "Frieda,Freddy",
+ "Gabriel,Gabby", "Gabriel,Gabe", "Gabriella,Ella",
+ "Gabriella,Gabby", "Gabrielle,Ella", "Gabrielle,Gabby",
+ "Genevieve,Eve", "Genevieve,Jean", "Genevieve,Jenny",
+ "Geoffrey,Geoff", "Geoffrey,Jeff", "Gerald,Gerry",
+ "Gerald,Jerry", "Geraldine,Dina", "Geraldine,Gerrie",
+ "Geraldine,Gerry", "Geraldine,Jerry", "Gertrude,Gert",
+ "Gertrude,Gertie", "Gertrude,Trudy", "Gilbert,Bert",
+ "Gilbert,Gil", "Gilbert,Wilber", "Gwendolyn,Gwen",
+ "Gwendolyn,Wendy", "Hannah,Anna", "Hannah,Nan", "Hannah,Nanny",
+ "Harold,Hal", "Harold,Harry", "Harriet,Hattie", "Helen,Ella",
+ "Helen,Ellen", "Helen,Ellie", "Helen,Lena", "Helene,Ella",
+ "Helene,Ellen", "Helene,Ellie", "Helene,Lena",
+ "Heloise,Eloise", "Heloise,Elouise", "Heloise,Lois",
+ "Henrietta,Etta", "Henrietta,Etty", "Henrietta,Hank",
+ "Henrietta,Nettie", "Henrietta,Retta", "Henry,Hal",
+ "Henry,Hank", "Henry,Harry", "Hephsibah,Hipsie",
+ "Hepsibah,Hipsie", "Herbert,Bert", "Herbert,Herb",
+ "Hermione,Hermie", "Hester,Esther", "Hester,Hessy",
+ "Hester,Hetty", "Hezekiah,Hez", "Hezekiah,Hy", "Hezekiah,Kiah",
+ "Hiram,Hy", "Hopkins,Hop", "Hopkins,Hopp", "Horace,Horry",
+ "Hubert,Bert", "Hubert,Hub", "Hubert,Hugh", "Ignatius,Iggy",
+ "Ignatius,Nace", "Ignatius,Nate", "Ignatius,Natius",
+ "Irene,Rena", "Irving,Irv", "Isaac,Ike", "Isaac,Zeke",
+ "Isabel,Bell", "Isabel,Bella", "Isabel,Belle", "Isabel,Ib",
+ "Isabel,Issy", "Isabel,Nib", "Isabel,Nibby", "Isabel,Tibbie",
+ "Isabella,Bella", "Isabella,Belle", "Isabella,Ib",
+ "Isabella,Issy", "Isabella,Nib", "Isabella,Nibby",
+ "Isabella,Tibbie", "Isabelle,Bella", "Isabelle,Belle",
+ "Isabelle,Ib", "Isabelle,Issy", "Isabelle,Nib",
+ "Isabelle,Nibby", "Isabelle,Tibbie", "Isadora,Dora",
+ "Isadora,Issy", "Isidore,Izzy", "Jacob,Jaap", "Jacob,Jake",
+ "Jacob,Jay", "Jacobus,Jacob", "James,Jamie", "James,Jem",
+ "James,Jim", "James,Jimmie", "James,Jimmy", "Jane,Janie",
+ "Jane,Jean", "Jane,Jennie", "Jane,Jessie", "Janet,Jan",
+ "Janet,Jessie", "Janice,Jan", "Jean,Jane", "Jean,Jeannie",
+ "Jeanette,Janet", "Jeanette,Jean", "Jeanette,Jessie",
+ "Jeanette,Nettie", "Jeanne,Jane", "Jeanne,Jeannie",
+ "Jedidiah,Jed", "Jefferson,Jeff", "Jefferson,Sonny",
+ "Jeffrey,Geoff", "Jeffrey,Jeff", "Jehiel,Hiel", "Jemima,Mima",
+ "Jennifer,Jennie", "Jeremiah,Jereme", "Jeremiah,Jerry",
+ "Jessica,Jessie", "Joan,Jo", "Joan,Nonie", "Joann,Jo",
+ "Joanna,Hannah", "Joanna,Jo", "Joanna,Joan", "Joanna,Jody",
+ "Joanne,Jo", "Johanna,Jo", "Johannah,Hannah", "Johannah,Joan",
+ "Johannah,Jody", "Johannah,Nonie", "John,Jack", "John,Jock",
+ "John,Johnny", "Jon,John", "Jon,Nathan", "Jonathan,John",
+ "Jonathan,Nathan", "Joseph,Jody", "Joseph,Joe", "Joseph,Joey",
+ "Joseph,Jos", "Josephine,Fina", "Josephine,Jo",
+ "Josephine,Jody", "Josephine,Joey", "Josephine,Josey",
+ "Joshua,Jos", "Joshua,Josh", "Josiah,Jos", "Joyce,Joy",
+ "Juanita,Nettie", "Juanita,Nita", "Judson,Jud", "Judson,Sonny",
+ "Julia,Jill", "Julia,Julie", "Julian,Jule", "Julias,Jule",
+ "Junior,JR", "Junior,June", "Junior,Junie", "Kasey,K.C.",
+ "Katelin,Kate", "Katelin,Kay", "Katelin,Kaye", "Katelyn,Kate",
+ "Katelyn,Kay", "Katelyn,Kaye", "Katherine,Cassie",
+ "Katherine,Cathy", "Katherine,Kate", "Katherine,Kathy",
+ "Katherine,Katy", "Katherine,Kay", "Katherine,Kaye",
+ "Katherine,Kit", "Katherine,Kittie", "Katherine,Lena",
+ "Katherine,Trina", "Kathleen,Cassie", "Kathleen,Cathy",
+ "Kathleen,Kathy", "Kathleen,Katy", "Kathleen,Kay",
+ "Kathleen,Kit", "Kathleen,Kittie", "Kathleen,Lena",
+ "Kathleen,Trina", "Kathryn,Kathy", "Kendall,Ken",
+ "Kendall,Kenny", "Kenneth,Ken", "Kenneth,Kendrick",
+ "Kenneth,Kenny", "Kent,Ken", "Kent,Kendrick", "Kent,Kenny",
+ "Keziah,Kizza", "Keziah,Kizzie", "Kimberley,Kim",
+ "Kimberly,Kim", "Kingsley,King", "Kingston,King",
+ "Kristen,Chris", "Kristin,Chris", "Kristine,Chris",
+ "Kristine,Christy", "Kristine,Crissy", "Kristine,Kris",
+ "Kristine,Kristy", "Kristine,Tina", "Kristy,Chris",
+ "Lafayette,Fate", "Lafayette,Laffie", "Lamont,Monty",
+ "Laurence,Larry", "Laurence,Lon", "Laurence,Lonny",
+ "Laurence,Lorne", "Laurence,Lorry", "Lavina,Ina",
+ "Lavina,Vina", "Lavina,Viney", "Lavinia,Ina", "Lavinia,Vina",
+ "Lavinia,Viney", "Lawrence,Larry", "Lawrence,Lon",
+ "Lawrence,Lonny", "Lawrence,Lorne", "Lawrence,Lorry",
+ "LeRoy,L.R.", "LeRoy,Lee", "LeRoy,Roy", "Lemuel,Lem",
+ "Lenora,Lee", "Lenora,Nora", "Leonard,Len", "Leonard,Lenny",
+ "Leonard,Leo", "Leonard,Leon", "Leonard,Lineau", "Leslie,Les",
+ "Lester,Les", "Letitia,Lettice", "Letitia,Lettie",
+ "Letitia,Tish", "Letitia,Titia", "Levi,Lee", "Lidia,Lyddy",
+ "Lillah,Lil", "Lillah,Lilly", "Lillah,Lily", "Lillah,Lolly",
+ "Lillian,Lil", "Lillian,Lilly", "Lillian,Lolly",
+ "Lincoln,Link", "Linda,Lindy", "Linda,Lynn", "Lisa,Alice",
+ "Lisa,Melissa", "Lois,Louise", "Lorenzo,Loren", "Loretta,Etta",
+ "Loretta,Lorrie", "Loretta,Retta", "Lorraine,Lorrie",
+ "Louisa,Eliza", "Louisa,Lois", "Louisa,Lou", "Louise,Eliza",
+ "Louise,Lois", "Louise,Lou", "Lucas,Luke", "Lucias,Luke",
+ "Lucille,Cille", "Lucille,Lou", "Lucille,Lu", "Lucille,Lucy",
+ "Lucinda,Cindy", "Lucinda,Lou", "Lucinda,Lu", "Lucinda,Lucy",
+ "Luella,Ella", "Luella,Lu", "Luella,Lula", "Luther,Luke",
+ "Lydia,Lyddy", "Lyndon,Lindy", "Lyndon,Lynn", "Madeline,Lena",
+ "Madeline,Maddy", "Madeline,Madge", "Madeline,Magda",
+ "Madeline,Maggie", "Magdelina,Lena", "Magdelina,Madge",
+ "Magdelina,Magda", "Mahala,Hallie", "Marcus,Mark",
+ "Margaret,Daisy", "Margaret,Gretta", "Margaret,Madge",
+ "Margaret,Maggie", "Margaret,Maggy", "Margaret,Marge",
+ "Margaret,Margery", "Margaret,Margie", "Margaret,Margy",
+ "Margaret,Meg", "Margaret,Midge", "Margaret,Peg",
+ "Margaret,Peggy", "Margaret,Rita", "Margaretta,Daisy",
+ "Margaretta,Gretta", "Margaretta,Madge", "Margaretta,Maggie",
+ "Margaretta,Marge", "Margaretta,Margery", "Margaretta,Margie",
+ "Margaretta,Meg", "Margaretta,Midge", "Margaretta,Peg",
+ "Margaretta,Peggy", "Margaretta,Rita", "Marjorie,Margie",
+ "Marjorie,Margy", "Martha,Marty", "Martha,Mat",
+ "Martha,Mattie", "Martha,Patsy", "Martha,Patty",
+ "Martin,Marty", "Martina,Tina", "Marvin,Marv", "Mary,Mae",
+ "Mary,Mamie", "Mary,Mitzi", "Mary,Molly", "Mary,Polly",
+ "Matilda,Matty", "Matilda,Maud", "Matilda,Tilly",
+ "Matthew,Matt", "Matthew,Mattie", "Matthew,Matty",
+ "Matthew,Thias", "Matthew,Thys", "Matthias,Matt",
+ "Matthias,Thias", "Matthias,Thys", "Maurice,Morey",
+ "Mehitabel,Hetty", "Mehitabel,Hitty", "Mehitabel,Mabel",
+ "Mehitabel,Mitty", "Melinda,Linda", "Melinda,Lindy",
+ "Melinda,Lynn", "Melinda,Mel", "Melinda,Mindy", "Melissa,Lisa",
+ "Melissa,Lissa", "Melissa,Mel", "Melissa,Milly",
+ "Melissa,Missy", "Mervyn,Merv", "Michael,Micah",
+ "Michael,Mick", "Michael,Micky", "Michael,Mike",
+ "Michelle,Mickey", "Mildred,Milly", "Millicent,Milly",
+ "Millicent,Missy", "Minerva,Minnie", "Miranda,Mandy",
+ "Miranda,Mira", "Miranda,Randy", "Miriam,Mimi", "Miriam,Mitzi",
+ "Mitchell,Mitch", "Montgomery,Gum", "Montgomery,Monty",
+ "Morris,Morey", "Nancy,Ann", "Nancy,Nan", "Napoleon,Leon",
+ "Napoleon,Nap", "Napoleon,Nappy", "Natalie,Natty",
+ "Natalie,Nettie", "Nathan,Nat", "Nathan,Nate", "Nathaniel,Nat",
+ "Nathaniel,Nate", "Nathaniel,Nathan", "Nathaniel,Natty",
+ "Nathaniel,Than", "Nicholas,Claas", "Nicholas,Claes",
+ "Nicholas,Nick", "Norbert,Bert", "Norbert,Norby",
+ "Obadiah,Diah", "Obadiah,Dyer", "Obadiah,Obed", "Obadiah,Obie",
+ "Olive,Livia", "Olive,Nollie", "Olive,Ollie", "Oliver,Ollie",
+ "Olivia,Livia", "Olivia,Nollie", "Olivia,Ollie", "Oswald,Ossy",
+ "Oswald,Ozzy", "Oswald,Waldo", "Pamela,Pam", "Parmelia,Amelia",
+ "Parmelia,Melia", "Parmelia,Milly", "Patience,Pat",
+ "Patience,Patty", "Patricia,Pat", "Patricia,Patsy",
+ "Patricia,Patty", "Patricia,Tricia", "Patrick,Paddy",
+ "Patrick,Pat", "Patrick,Pate", "Patrick,Patsy",
+ "Patrick,Peter", "Paula,Lina", "Paula,Polly", "Paulina,Lina",
+ "Paulina,Polly", "Pelegrine,Perry", "Penelope,Penny",
+ "Percival,Percy", "Peter,Pate", "Peter,Pete", "Philetus,Leet",
+ "Philetus,Phil", "Philinda,Linda", "Philinda,Lindy",
+ "Philinda,Lynn", "Philip,Phil", "Phillip,Phil",
+ "Prescott,Pres", "Prescott,Scott", "Prescott,Scotty",
+ "Priscilla,Cilla", "Priscilla,Cissy", "Priscilla,Prissy",
+ "Prudence,Prudy", "Prudence,Prue", "Rachel,Shelly",
+ "Rafaela,Rafa", "Randolph,Dolph", "Randolph,Randy",
+ "Raphael,Ralph", "Raymond,Ray", "Rebecca,Becca",
+ "Rebecca,Beck", "Rebecca,Becky", "Rebecca,Reba", "Regina,Gina",
+ "Regina,Reggie", "Reginald,Naldo", "Reginald,Reg",
+ "Reginald,Reggie", "Reginald,Renny", "Relief,Leafa",
+ "Reuben,Rube", "Ricardo,Rick", "Ricardo,Ricky", "Richard,Dick",
+ "Richard,Dickie", "Richard,Dickon", "Richard,Dicky",
+ "Richard,Rich", "Richard,Rick", "Richard,Ricky", "Robert,Bob",
+ "Robert,Bobby", "Robert,Dob", "Robert,Dobbin", "Robert,Hob",
+ "Robert,Hobkin", "Robert,Rob", "Roberta,Bert",
+ "Roberta,Bertie", "Roberta,Birdie", "Roberta,Bobbie",
+ "Roberta,Robbie", "Rodger,Bobby", "Rodger,Hodge",
+ "Rodger,Robby", "Rodger,Robin", "Rodger,Rod", "Rodger,Roge",
+ "Rodger,Rupert", "Roger,Bobby", "Roger,Hodge", "Roger,Robby",
+ "Roger,Robin", "Roger,Rod", "Roger,Roge", "Roger,Rupert",
+ "Roland,Lanny", "Roland,Orlando", "Roland,Rollo",
+ "Roland,Rolly", "Ronald,Naldo", "Ronald,Ron", "Ronald,Ronny",
+ "Rosabel,Belle", "Rosabel,Rosa", "Rosabel,Rose", "Rosabel,Roz",
+ "Rosabella,Belle", "Rosabella,Rosa", "Rosabella,Rose",
+ "Rosabella,Roz", "Rosalinda,Linda", "Rosalinda,Rosa",
+ "Rosalinda,Rose", "Rosalinda,Roz", "Rosalyn,Linda",
+ "Rosalyn,Rosa", "Rosalyn,Rose", "Rosalyn,Roz", "Roseann,Ann",
+ "Roseann,Rose", "Roseann,Rosie", "Roseann,Roz", "Roseanna,Ann",
+ "Roseanna,Rose", "Roseanna,Rosie", "Roseanna,Roz",
+ "Roseanne,Ann", "Roxanna,Ann", "Roxanna,Rose", "Roxanna,Roxie",
+ "Roxanne,Ann", "Roxanne,Rose", "Roxanne,Roxie",
+ "Rudolph,Dolph", "Rudolph,Olph", "Rudolph,Rolf",
+ "Rudolph,Rudy", "Rudolphus,Dolph", "Rudolphus,Olph",
+ "Rudolphus,Rolf", "Rudolphus,Rudy", "Russell,Russ",
+ "Russell,Rusty", "Sabrina,Brina", "Samuel,Sam", "Samuel,Sammy",
+ "Sandra,Cassandra", "Sandra,Sandy", "Sarah,Sadie",
+ "Sarah,Sally", "Serena,Rena", "Seymour,Morey", "Seymour,See",
+ "Shelton,Shel", "Shelton,Shelly", "Shelton,Tony",
+ "Sheridan,Dan", "Sheridan,Danny", "Sheridan,Sher",
+ "Shirley,Lee", "Shirley,Sherry", "Shirley,Shirl", "Sidney,Sid",
+ "Sidney,Syd", "Silas,Si", "Simeon,Si", "Simeon,Sion",
+ "Simon,Si", "Simon,Sion", "Smith,Smitty", "Solomon,Sal",
+ "Solomon,Salmon", "Solomon,Saul", "Solomon,Sol",
+ "Solomon,Solly", "Solomon,Zolly", "Sophia,Sophie",
+ "Stephan,Steve", "Stephen,Steph", "Stephen,Steve",
+ "Steven,Steph", "Steven,Steve", "Stuart,Stu", "Submit,Mitty",
+ "Sullivan,Sully", "Sullivan,Van", "Susan,Hannah", "Susan,Sue",
+ "Susan,Sukey", "Susan,Susie", "Susan,Suzie", "Susannah,Hannah",
+ "Susannah,Sue", "Susannah,Sukey", "Susannah,Susie",
+ "Sylvester,Si", "Sylvester,Sly", "Sylvester,Sy",
+ "Sylvester,Syl", "Sylvester,Vessie", "Sylvester,Vester",
+ "Sylvester,Vet", "Tabitha,Tabby", "Terence,Terry",
+ "Teresa,Terry", "Thaddeus,Thad", "Theodore,Ted",
+ "Theodore,Teddy", "Theodore,Theo", "Theresa,Terry",
+ "Theresa,Tess", "Theresa,Tessa", "Theresa,Tessie",
+ "Theresa,Thirza", "Theresa,Thursa", "Theresa,Tracy",
+ "Thom,Tom", "Thom,Tommy", "Thomas,Thom", "Thomas,Tom",
+ "Thomas,Tommy", "Timothy,Tim", "Timothy,Timmy", "Tobias,Bias",
+ "Tobias,Toby", "Tryphena,Phena", "Uriah,Riah",
+ "Valentine,Felty", "Valeri,Val", "Valerie,Val", "Vanessa,Essa",
+ "Vanessa,Nessa", "Vanessa,Vanna", "Veronica,Franky",
+ "Veronica,Frony", "Veronica,Ron", "Veronica,Ronie",
+ "Veronica,Ronna", "Veronica,Ronnie", "Veronica,Vonnie",
+ "Victor,Vic", "Victoria,Torie", "Victoria,Tory",
+ "Victoria,Vic", "Victoria,Vicki", "Victoria,Vicky",
+ "Vincent,Vic", "Vincent,Vin", "Vincent,Vince",
+ "Vincent,Vinnie", "Vincent,Vinny", "Vincenzo,Vic",
+ "Vincenzo,Vin", "Vincenzo,Vinnie", "Vincenzo,Vinny",
+ "Vinson,Vinny", "Virginia,Ginger", "Virginia,Ginny",
+ "Virginia,Jane", "Virginia,Jennie", "Virginia,Virgy",
+ "Wallace,Wally", "Walter,Wally", "Walter,Walt",
+ "Washington,Wash", "Wilber,Bert", "Wilber,Will",
+ "Wilbur,Willie", "Wilbur,Willy", "Wilfred,Fred",
+ "Wilfred,Will", "Wilfred,Willie", "Wilhelmina,Mina",
+ "Wilhelmina,Minnie", "Wilhelmina,Willie", "Wilhelmina,Wilma",
+ "Will,Fred", "William,Bela", "William,Bell", "William,Bill",
+ "William,Billy", "William,Will", "William,Willie",
+ "William,Willy", "Willie,Fred", "Wilson,Will", "Wilson,Willie",
+ "Wilson,Willy", "Winfield,Field", "Winfield,Win",
+ "Winfield,Winny", "Winifred,Freddie", "Winifred,Winnet",
+ "Winifred,Winnie", "Winnifred,Fred", "Winnifred,Freddie",
+ "Winnifred,Freddy", "Winnifred,Winnie", "Winnifred,Winny",
+ "Woodrow,Drew", "Woodrow,Wood", "Woodrow,Woody",
+ "Yvonne,Vonna", "Zachariah,Zach", "Zachariah,Zachy",
+ "Zachariah,Zeke", "Zebedee,Zeb", "Zedediah,Diah",
+ "Zedediah,Dyer", "Zedediah,Zed", "Zephaniah,Zeph" };
+
+ String source = (String) aContext.getConfigParameterValue("SourceFile");
+
+ nicknames = new HashMap();
+ for (int i=0; i < name_list.length; i++) {
+ String name2nick = name_list[i];
+ String[] names = name2nick.split(",");
+ if (!nicknames.containsKey(names[0])) {
+ nicknames.put(names[0], new ArrayList());
+ }
+ ArrayList nicks = (ArrayList)nicknames.get(names[1]);
+ if (nicks == null) {
+ nicks = new ArrayList();
+ nicknames.put(names[1], nicks);
+ }
+ nicks.add(names[0]);
+ }
+ }
Added: incubator/uima/sandbox/trunk/BSFAnnotator/desc/RhinoTestAnnotator.xml
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/desc/RhinoTestAnnotator.xml?rev=597458&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/BSFAnnotator/desc/RhinoTestAnnotator.xml (added)
+++ incubator/uima/sandbox/trunk/BSFAnnotator/desc/RhinoTestAnnotator.xml Thu Nov 22 09:27:22 2007
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<taeDescription xmlns="http://uima.apache.org/resourceSpecifier">
+<frameworkImplementation>org.apache.uima.java</frameworkImplementation>
+<primitive>true</primitive>
+<annotatorImplementationName>org.apache.uima.annotator.bsf.BSFAnnotator</annotatorImplementationName>
+<analysisEngineMetaData>
+<name>Rhino Annotator</name>
+<description>Test of Rhino BSF Annotator.</description>
+<version>1.0</version>
+<vendor>TEMIS</vendor>
+<configurationParameters>
+<configurationParameter>
+<name>SourceFile</name>
+<description>BSF script to be loaded</description>
+<type>String</type>
+<multiValued>false</multiValued>
+<mandatory>true</mandatory>
+</configurationParameter>
+<configurationParameter>
+<name>Regexp</name>
+<description>Regular expression</description>
+<type>String</type>
+<multiValued>false</multiValued>
+<mandatory>true</mandatory>
+</configurationParameter>
+</configurationParameters>
+<configurationParameterSettings>
+<nameValuePair>
+<name>SourceFile</name>
+<value>
+<string>TEST.js</string>
+</value>
+</nameValuePair>
+<nameValuePair>
+<name>Regexp</name>
+<value>
+<string>Dave|David|Bob|Tim|Joe</string>
+</value>
+</nameValuePair>
+</configurationParameterSettings>
+<typeSystemDescription>
+ <typeDescription>
+ <name>org.apache.uima.annotator.bsf.types.Token</name>
+ <description></description>
+ <supertypeName>uima.tcas.Annotation</supertypeName>
+ <features/>
+ </typeDescription>
+</typeSystemDescription>
+<typePriorities/>
+<fsIndexCollection/>
+<capabilities>
+<capability>
+<inputs/>
+<outputs/>
+<languagesSupported>
+<language>x-unspecified</language>
+</languagesSupported>
+</capability>
+</capabilities>
+<operationalProperties>
+<modifiesCas>true</modifiesCas>
+<multipleDeploymentAllowed>true</multipleDeploymentAllowed>
+<outputsNewCASes>false</outputsNewCASes>
+</operationalProperties>
+</analysisEngineMetaData>
+</taeDescription>
Added: incubator/uima/sandbox/trunk/BSFAnnotator/desc/TEST.bsh
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/desc/TEST.bsh?rev=597458&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/BSFAnnotator/desc/TEST.bsh (added)
+++ incubator/uima/sandbox/trunk/BSFAnnotator/desc/TEST.bsh Thu Nov 22 09:27:22 2007
@@ -0,0 +1,68 @@
+/**
+ * Example of beanshell script to be used as input for the
+ * BSFAnnotator
+ * @author Olivier Terrier
+ * @version 1.0
+ */
+
+import org.apache.uima.analysis_engine.ResultSpecification;
+import org.apache.uima.analysis_engine.annotator.AnnotatorConfigurationException;
+import org.apache.uima.analysis_engine.annotator.AnnotatorContext;
+import org.apache.uima.analysis_engine.annotator.AnnotatorContextException;
+import org.apache.uima.analysis_engine.annotator.AnnotatorInitializationException;
+import org.apache.uima.analysis_engine.annotator.AnnotatorProcessException;
+import org.apache.uima.analysis_engine.annotator.JTextAnnotator_ImplBase;
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.util.Level;
+import org.apache.uima.util.Logger;
+import org.apache.uima.cas.*;
+import org.apache.uima.jcas.cas.*;
+import org.apache.uima.jcas.tcas.*;
+import org.apache.uima.annotator.bsf.types.Token;
+
+import java.util.regex.*;
+
+/**
+ * Initialisation of global variables
+ */
+String scriptName;
+Pattern matchPattern;
+
+/**
+ * Performs any startup tasks required by this annotator.
+ * The Analysis Engine calls this method only once, just after an Annotator has been instantiated.
+ * @param aContext Provides access to external resources that may be used by this annotator.
+ * This includes configuration parameters, logging and instrumentation services, and access to external analysis resources.
+ * @see com.ibm.uima.analysis_engine.annotator.BaseAnnotator#initialize(com.ibm.uima.analysis_engine.annotator.AnnotatorContext)
+ */
+public void initialize(AnnotatorContext aContext)
+ throws AnnotatorInitializationException,
+ AnnotatorConfigurationException {
+
+ String source = (String) aContext.getConfigParameterValue("SourceFile");
+ String regexp = (String) aContext.getConfigParameterValue("Regexp");
+ if (regexp == null)
+ regexp = "Dave|David|Bob|Tim|Joe";
+ matchPattern = Pattern.compile(regexp);
+}
+
+/**
+ * Invokes this annotator's analysis logic.
+ * This annotator will access the data in the JCas and add new data to the JCas.
+ * @param jcas contains the document to be analyzed and may contain other metadata about that document.
+ * @param rs a list of output types and features that this annotator should produce.
+ */
+public void process(JCas jcas, ResultSpecification rs)
+ throws AnnotatorProcessException {
+
+ // Looking for regexp in the document text and storing start/end indexes in arrays
+ String text = jcas.getDocumentText();
+ Matcher matcher = matchPattern.matcher(text);
+ List annotArray = new ArrayList();
+ while (matcher.find()) {
+ // Create an EntityOccurrence for each firstname found in the text
+ Token token = new Token(jcas, matcher.start(), matcher.end());
+ token.addToIndexes();
+ }
+}
+
Added: incubator/uima/sandbox/trunk/BSFAnnotator/desc/TEST.js
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/desc/TEST.js?rev=597458&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/BSFAnnotator/desc/TEST.js (added)
+++ incubator/uima/sandbox/trunk/BSFAnnotator/desc/TEST.js Thu Nov 22 09:27:22 2007
@@ -0,0 +1,27 @@
+// Example of javascript script to be used as input for the BSFAnnotator
+importPackage(Packages.org.apache.uima.analysis_engine);
+importPackage(Packages.org.apache.uima.analysis_engine.annotator);
+importPackage(Packages.org.apache.uima.jcas);
+importPackage(Packages.org.apache.uima.jcas.tcas);
+importPackage(Packages.org.apache.uima.annotator.bsf.types);
+importPackage(java.util.regex);
+
+var matchPattern;
+
+// Annotator initialize method
+// see org.apache.uima.analysis_engine.annotator.Annotator_ImplBase#initialize(org.apache.uima.analysis_engine.annotator.AnnotatorContext)
+function initialize(context) {
+ var pattern = context.getConfigParameterValue("Regexp");
+ matchPattern = Pattern.compile(pattern);
+}
+
+// Annotator process method
+// see org.apache.uima.analysis_engine.annotator.JTextAnnotator#process(org.apache.uima.jcas.JCas, org.apache.uima.analysis_engine.ResultSpecification)
+function process(jcas, rs) {
+ var text = jcas.getDocumentText();
+ var matcher = matchPattern.matcher(text);
+ while (matcher.find()) {
+ var token = new Token(jcas, matcher.start(), matcher.end());
+ token.addToIndexes();
+ }
+}
Added: incubator/uima/sandbox/trunk/BSFAnnotator/lib/bsf.jar
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/lib/bsf.jar?rev=597458&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/uima/sandbox/trunk/BSFAnnotator/lib/bsf.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/uima/sandbox/trunk/BSFAnnotator/lib/bsh-bsf.jar
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/lib/bsh-bsf.jar?rev=597458&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/uima/sandbox/trunk/BSFAnnotator/lib/bsh-bsf.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/uima/sandbox/trunk/BSFAnnotator/lib/bsh.jar
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/lib/bsh.jar?rev=597458&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/uima/sandbox/trunk/BSFAnnotator/lib/bsh.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/uima/sandbox/trunk/BSFAnnotator/lib/commons-logging-api-1.1.jar
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/lib/commons-logging-api-1.1.jar?rev=597458&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/uima/sandbox/trunk/BSFAnnotator/lib/commons-logging-api-1.1.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/uima/sandbox/trunk/BSFAnnotator/lib/js.jar
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/lib/js.jar?rev=597458&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/uima/sandbox/trunk/BSFAnnotator/lib/js.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/uima/sandbox/trunk/BSFAnnotator/lib/log4j-1.2.15.jar
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/lib/log4j-1.2.15.jar?rev=597458&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/uima/sandbox/trunk/BSFAnnotator/lib/log4j-1.2.15.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/uima/sandbox/trunk/BSFAnnotator/pom.xml
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/pom.xml?rev=597458&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/BSFAnnotator/pom.xml (added)
+++ incubator/uima/sandbox/trunk/BSFAnnotator/pom.xml Thu Nov 22 09:27:22 2007
@@ -0,0 +1,157 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.uima</groupId>
+ <artifactId>BSFAnnotator</artifactId>
+ <packaging>jar</packaging>
+ <version>2.2.0-incubating</version>
+ <name>Apache UIMA Java Annotator - BSFAnnotator</name>
+ <url>http://incubator.apache.org/uima</url>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.uima</groupId>
+ <artifactId>uimaj-core</artifactId>
+ <version>2.2.0-incubating</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.uima</groupId>
+ <artifactId>PearPackagingMavenPlugin</artifactId>
+ <version>2.2.0-incubating-SNAPSHOT</version>
+ <scope>package</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.uima</groupId>
+ <artifactId>uimaj-test-util</artifactId>
+ <version>2.2.0-incubating</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.uima</groupId>
+ <artifactId>uimaj-component-test-util</artifactId>
+ <version>2.2.0-incubating</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>local.bsf.dependency</groupId>
+ <artifactId>bsf</artifactId>
+ <version>2.4.0</version>
+ <scope>system</scope>
+ <systemPath>${basedir}/lib/bsf.jar</systemPath>
+ </dependency>
+ <dependency>
+ <groupId>local.bsf.dependency</groupId>
+ <artifactId>beanshell</artifactId>
+ <version>2.0b4</version>
+ <scope>system</scope>
+ <systemPath>${basedir}/lib/bsh.jar</systemPath>
+ </dependency>
+ <dependency>
+ <groupId>local.bsf.dependency</groupId>
+ <artifactId>beanshell-bsf</artifactId>
+ <version>2.0b4</version>
+ <scope>system</scope>
+ <systemPath>${basedir}/lib/bsh-bsf.jar</systemPath>
+ </dependency>
+ <dependency>
+ <groupId>local.bsf.dependency</groupId>
+ <artifactId>Rhino</artifactId>
+ <version>1.6R7</version>
+ <scope>system</scope>
+ <systemPath>${basedir}/lib/js.jar</systemPath>
+ </dependency>
+ <dependency>
+ <groupId>local.bsf.dependency</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.15</version>
+ <scope>system</scope>
+ <systemPath>${basedir}/lib/log4j-1.2.15.jar</systemPath>
+ </dependency>
+ <dependency>
+ <groupId>local.bsf.dependency</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1</version>
+ <scope>system</scope>
+ <systemPath>${basedir}/lib/commons-logging-api-1.1.jar</systemPath>
+ </dependency>
+
+ </dependencies>
+ <build>
+ <finalName>uimaj-an-bsf</finalName>
+ <resources>
+ <resource>
+ <directory>desc</directory>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <!--
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <ant antfile="build_documentation.xml" target="copyDocs"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.uima</groupId>
+ <artifactId>PearPackagingMavenPlugin</artifactId>
+ <extensions>true</extensions>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <configuration>
+ <classpath>$main_root/lib/jsr173_1.0_api.jar;$main_root/lib/xmltypes.jar;$main_root/lib/xbean.jar</classpath>
+ <mainComponentDesc>desc/RegExAnnotator.xml</mainComponentDesc>
+ <componentId>RegExAnnotator</componentId>
+ <mainComponentDir>${basedir}</mainComponentDir>
+ <targetDir>${basedir}/target</targetDir>
+ </configuration>
+ <goals>
+ <goal>package</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ -->
+ </plugins>
+ </build>
+ <repositories>
+ <repository>
+ <id>ApacheIncubatorRepository</id>
+ <url>
+ http://people.apache.org/repo/m2-incubating-repository/
+ </url>
+ </repository>
+ </repositories>
+</project>
Added: incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/BSFAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/BSFAnnotator.java?rev=597458&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/BSFAnnotator.java (added)
+++ incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/BSFAnnotator.java Thu Nov 22 09:27:22 2007
@@ -0,0 +1,239 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.uima.annotator.bsf;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.Reader;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.StringTokenizer;
+
+import org.apache.bsf.BSFEngine;
+import org.apache.bsf.BSFException;
+import org.apache.bsf.BSFManager;
+import org.apache.bsf.util.IOUtils;
+import org.apache.uima.analysis_engine.ResultSpecification;
+import org.apache.uima.analysis_engine.annotator.AnnotatorConfigurationException;
+import org.apache.uima.analysis_engine.annotator.AnnotatorContext;
+import org.apache.uima.analysis_engine.annotator.AnnotatorContextException;
+import org.apache.uima.analysis_engine.annotator.AnnotatorInitializationException;
+import org.apache.uima.analysis_engine.annotator.AnnotatorProcessException;
+import org.apache.uima.analysis_engine.annotator.JTextAnnotator_ImplBase;
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.util.Logger;
+
+/**
+ * This class enables the Java scripting of an Annotator using the Apache Bean
+ * Scripting Framework. It has a mandatory <code>SourceFile</code> attribute
+ * containing the script's source file to execute.
+ * <p>
+ */
+public class BSFAnnotator extends JTextAnnotator_ImplBase {
+
+ public static final String MESSAGE_DIGEST = "org.apache.uima.annotator.bsf.BSFAnnotatorMessages";
+
+ public static final String PATH_SEPARATOR = System.getProperty("path.separator");
+
+ public static final String SCRIPT_SOURCE_FILE = "SourceFile";
+
+ private Logger logger;
+ private BSFManager manager;
+ private BSFEngine engine;
+ String scriptLanguage;
+ String scriptFileName;
+
+
+ /**
+ * Initializes the annotator by compiling the script.
+ */
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.analysis_engine.annotator.Annotator_ImplBase#initialize(org.apache.uima.analysis_engine.annotator.AnnotatorContext)
+ */
+ public void initialize(AnnotatorContext aContext)
+ throws AnnotatorInitializationException,
+ AnnotatorConfigurationException {
+ super.initialize(aContext);
+ // Initialize a BSF manager and do some 'cooking' to adapt the class loader
+ manager = new BSFManager();
+ ClassLoader classLoader = this.getClass().getClassLoader();
+ Thread.currentThread().setContextClassLoader(classLoader);
+ manager.setClassLoader(classLoader);
+ // Is a UIMAClassLoader
+ if (classLoader instanceof URLClassLoader) {
+ manager.setClassPath(classpathFromUrls(((URLClassLoader) classLoader).getURLs()));
+ }
+ Reader reader = null;
+ scriptFileName = null;
+ try {
+ logger = aContext.getLogger();
+ // get UIMA datapath and tokenize it into its elements
+ StringTokenizer tokenizer = new StringTokenizer(aContext
+ .getDataPath(), PATH_SEPARATOR);
+ ArrayList datapathElements = new ArrayList();
+ while (tokenizer.hasMoreTokens()) {
+ // add datapath elements to the 'datapathElements' array list
+ datapathElements.add(new File(tokenizer.nextToken()));
+ }
+
+ // Get config. parameter values
+ scriptFileName = (String) aContext.getConfigParameterValue(SCRIPT_SOURCE_FILE);
+ File scriptFile = new File(scriptFileName);
+ if (!scriptFile.isAbsolute()) {
+ // try to resolve the relative file name with classpath or
+ // datapath
+ scriptFile = resolveRelativeFilePath(scriptFileName, datapathElements);
+
+ // if the current script file wasn't found, throw an exception
+ if (scriptFile == null) {
+ throw new BSFAnnotatorConfigurationException(
+ "bsf_annotator_resource_not_found",
+ new Object[] { scriptFileName });
+ }
+ }
+ reader = new FileReader(scriptFile);
+ } catch (AnnotatorContextException ex) {
+ throw new AnnotatorInitializationException(ex);
+ } catch (FileNotFoundException fnfe) {
+ throw new BSFAnnotatorConfigurationException(
+ "bsf_annotator_resource_not_found",
+ new Object[] { scriptFileName }, fnfe);
+ }
+
+ try {
+ scriptLanguage = BSFManager.getLangFromFilename(scriptFileName);
+ engine = manager.loadScriptingEngine(scriptLanguage);
+ } catch (BSFException bsfe) {
+ Throwable cause = bsfe.getTargetException();
+ if (cause == null) cause = bsfe;
+ throw new BSFAnnotatorConfigurationException(
+ "bsf_annotator_language_not_supported",
+ new Object[] { scriptLanguage }, cause);
+ }
+
+ // read and execute the script
+ try {
+ String script = IOUtils.getStringFromReader(reader);
+ engine.exec(scriptFileName, 0, 0, script);
+ } catch (IOException ioe) {
+ throw new BSFAnnotatorInitializationException(
+ "bsf_annotator_error_reading_script",
+ new Object[] { scriptFileName }, ioe);
+ } catch (BSFException bsfe) {
+ Throwable cause = bsfe.getTargetException();
+ if (cause == null) cause = bsfe;
+ throw new BSFAnnotatorInitializationException(
+ "bsf_annotator_error_executing_script",
+ new Object[] { scriptFileName }, cause);
+ } finally {
+ if (reader != null) {
+ try {
+ reader.close();
+ } catch (IOException e) {
+ }
+ }
+ }
+ // Call the initialize function implemented in the script
+ String methodName = null;
+ try {
+ methodName = "initialize";
+ engine.call(null, methodName, new Object[] { aContext });
+ } catch (BSFException bsfe) {
+ Throwable cause = bsfe.getTargetException();
+ if (cause == null) cause = bsfe;
+ throw new BSFAnnotatorInitializationException(
+ "bsf_annotator_error_calling_method",
+ new Object[] { methodName }, cause);
+ }
+
+ }
+
+ /**
+ * Call the process function implemented in the script
+ */
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.analysis_engine.annotator.JTextAnnotator#process(org.apache.uima.jcas.JCas,
+ * org.apache.uima.analysis_engine.ResultSpecification)
+ */
+ public void process(JCas jcas, ResultSpecification result)
+ throws AnnotatorProcessException {
+
+ String methodName = null;
+ try {
+ methodName = "process";
+ engine.call(null, methodName, new Object[] { jcas, result });
+ } catch (BSFException bsfe) {
+ Throwable cause = bsfe.getTargetException();
+ if (cause == null) cause = bsfe;
+ throw new BSFAnnotatorProcessException(
+ "bsf_annotator_error_calling_method",
+ new Object[] { methodName }, cause);
+ }
+ }
+ /**
+ * @param fileName
+ * @param datapathElements
+ * @return
+ */
+ private File resolveRelativeFilePath(String fileName,
+ ArrayList datapathElements) {
+ URL url;
+ // try to use the class loader to load the file resource
+ if ((url = this.getClass().getClassLoader().getResource(fileName)) != null) {
+ return new File(url.getFile());
+ } else {
+ if (datapathElements == null || datapathElements.size() == 0) {
+ return null;
+ }
+ // try to use the datapath to load the file resource
+ for (int i = 0; i < datapathElements.size(); i++) {
+ File testFile = new File((File) datapathElements.get(i),
+ fileName);
+ if (testFile.exists()) {
+ return testFile;
+ }
+ }
+ }
+ return null;
+
+ }
+ /**
+ * @param urls
+ * @return
+ */
+ private String classpathFromUrls(URL[] urls) {
+ String classpath = null;
+ for (int i = 0; i < urls.length; i++) {
+ File filepath = new File(urls[i].getPath());
+ if (i == 0)
+ classpath = filepath.getPath();
+ else
+ classpath = classpath + File.pathSeparator + filepath.getPath();
+ }
+ return classpath;
+ }
+
+}
Added: incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/BSFAnnotatorConfigurationException.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/BSFAnnotatorConfigurationException.java?rev=597458&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/BSFAnnotatorConfigurationException.java (added)
+++ incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/BSFAnnotatorConfigurationException.java Thu Nov 22 09:27:22 2007
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.uima.annotator.bsf;
+
+import org.apache.uima.analysis_engine.annotator.AnnotatorConfigurationException;
+
+/**
+ *
+ *
+ */
+public class BSFAnnotatorConfigurationException extends AnnotatorConfigurationException {
+
+ /**
+ * Creates a new exception with a the specified message.
+ *
+ * @param aMessageKey
+ * an identifier that maps to the message for this exception. The message may contain
+ * placeholders for arguments as defined by the
+ * {@link java.text.MessageFormat MessageFormat} class.
+ * @param aArguments
+ * The arguments to the message. <code>null</code> may be used if the message has no
+ * arguments.
+ */
+ public BSFAnnotatorConfigurationException(String aMessageKey, Object[] aArguments) {
+ super(BSFAnnotator.MESSAGE_DIGEST, aMessageKey, aArguments);
+ }
+
+ /**
+ * Creates a new exception with the specified cause and a message from the
+ * {@link #STANDARD_MESSAGE_CATALOG}.
+ *
+ * @param aMessageKey
+ * an identifier that maps to the message for this exception. The message may contain
+ * placeholders for arguments as defined by the
+ * {@link java.text.MessageFormat MessageFormat} class.
+ * @param aArguments
+ * The arguments to the message. <code>null</code> may be used if the message has no
+ * arguments.
+ * @param aCause
+ * the original exception that caused this exception to be thrown, if any
+ */
+ public BSFAnnotatorConfigurationException(String aMessageKey, Object[] aArguments, Throwable aCause) {
+ super(BSFAnnotator.MESSAGE_DIGEST, aMessageKey, aArguments, aCause);
+ }
+
+}
Added: incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/BSFAnnotatorInitializationException.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/BSFAnnotatorInitializationException.java?rev=597458&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/BSFAnnotatorInitializationException.java (added)
+++ incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/BSFAnnotatorInitializationException.java Thu Nov 22 09:27:22 2007
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.uima.annotator.bsf;
+
+import org.apache.uima.analysis_engine.annotator.AnnotatorInitializationException;
+
+/**
+ *
+ *
+ */
+public class BSFAnnotatorInitializationException extends AnnotatorInitializationException {
+
+ /**
+ * Creates a new exception with a the specified message.
+ *
+ * @param aMessageKey
+ * an identifier that maps to the message for this exception. The message may contain
+ * placeholders for arguments as defined by the
+ * {@link java.text.MessageFormat MessageFormat} class.
+ * @param aArguments
+ * The arguments to the message. <code>null</code> may be used if the message has no
+ * arguments.
+ */
+ public BSFAnnotatorInitializationException(String aMessageKey, Object[] aArguments) {
+ super(BSFAnnotator.MESSAGE_DIGEST, aMessageKey, aArguments);
+ }
+
+ /**
+ * Creates a new exception with the specified cause and a message from the
+ * {@link #STANDARD_MESSAGE_CATALOG}.
+ *
+ * @param aMessageKey
+ * an identifier that maps to the message for this exception. The message may contain
+ * placeholders for arguments as defined by the
+ * {@link java.text.MessageFormat MessageFormat} class.
+ * @param aArguments
+ * The arguments to the message. <code>null</code> may be used if the message has no
+ * arguments.
+ * @param aCause
+ * the original exception that caused this exception to be thrown, if any
+ */
+ public BSFAnnotatorInitializationException(String aMessageKey, Object[] aArguments, Throwable aCause) {
+ super(BSFAnnotator.MESSAGE_DIGEST, aMessageKey, aArguments, aCause);
+ }
+
+}
Added: incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/BSFAnnotatorProcessException.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/BSFAnnotatorProcessException.java?rev=597458&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/BSFAnnotatorProcessException.java (added)
+++ incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/BSFAnnotatorProcessException.java Thu Nov 22 09:27:22 2007
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.uima.annotator.bsf;
+
+import org.apache.uima.analysis_engine.annotator.AnnotatorProcessException;
+
+/**
+ *
+ *
+ */
+public class BSFAnnotatorProcessException extends AnnotatorProcessException {
+
+
+ /**
+ * Creates a new exception with a the specified message.
+ *
+ * @param aMessageKey
+ * an identifier that maps to the message for this exception. The
+ * message may contain placeholders for arguments as defined by the
+ * {@link java.text.MessageFormat MessageFormat} class.
+ * @param aArguments
+ * The arguments to the message. <code>null</code> may be used if
+ * the message has no arguments.
+ */
+ public BSFAnnotatorProcessException(String aMessageKey, Object[] aArguments) {
+ super(BSFAnnotator.MESSAGE_DIGEST, aMessageKey, aArguments);
+ }
+
+ /**
+ * Creates a new exception with the specified cause and a message from the
+ * {@link #STANDARD_MESSAGE_CATALOG}.
+ *
+ * @param aMessageKey
+ * an identifier that maps to the message for this exception. The
+ * message may contain placeholders for arguments as defined by the
+ * {@link java.text.MessageFormat MessageFormat} class.
+ * @param aArguments
+ * The arguments to the message. <code>null</code> may be used if
+ * the message has no arguments.
+ * @param aCause
+ * the original exception that caused this exception to be thrown,
+ * if any
+ */
+ public BSFAnnotatorProcessException(String aMessageKey,
+ Object[] aArguments, Throwable aCause) {
+ super(BSFAnnotator.MESSAGE_DIGEST, aMessageKey, aArguments, aCause);
+ }
+
+ /**
+ * Creates a new exception with the specified cause and a null message.
+ *
+ * @param aCause
+ * the original exception that caused this exception to be thrown, if any
+ */
+ public BSFAnnotatorProcessException(Throwable aCause) {
+ super(aCause);
+ }
+
+}
Added: incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/BSFExampleTypes.xml
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/BSFExampleTypes.xml?rev=597458&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/BSFExampleTypes.xml (added)
+++ incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/BSFExampleTypes.xml Thu Nov 22 09:27:22 2007
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+ <!--
+ ***************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ***************************************************************
+ -->
+
+<typeSystemDescription xmlns="http://uima.apache.org/resourceSpecifier">
+ <name>BSF Example Types</name>
+ <description>Type system used by the org.apache.uima.annotator.bsf package. Defines token, sentence, named entity.</description>
+ <version>1.0</version>
+ <vendor>TEMIS</vendor>
+ <types>
+ <typeDescription>
+ <name>org.apache.uima.annotator.bsf.types.Token</name>
+ <description></description>
+ <supertypeName>uima.tcas.Annotation</supertypeName>
+ <features/>
+ </typeDescription>
+ <typeDescription>
+ <name>org.apache.uima.annotator.bsf.types.Firstname</name>
+ <description></description>
+ <supertypeName>uima.tcas.Annotation</supertypeName>
+ <features/>
+ </typeDescription>
+ <typeDescription>
+ <name>org.apache.uima.annotator.bsf.types.Nickname</name>
+ <description></description>
+ <supertypeName>org.apache.uima.annotator.bsf.types.Firstname</supertypeName>
+ <features>
+ <featureDescription>
+ <name>firstnames</name>
+ <description>List of possible firstnames related to this nickname</description>
+ <rangeTypeName>uima.cas.StringArray</rangeTypeName>
+ </featureDescription>
+ </features>
+ </typeDescription>
+ </types>
+</typeSystemDescription>
Added: incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Firstname.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Firstname.java?rev=597458&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Firstname.java (added)
+++ incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Firstname.java Thu Nov 22 09:27:22 2007
@@ -0,0 +1,62 @@
+
+
+/* First created by JCasGen Tue Nov 06 10:21:22 CET 2007 */
+package org.apache.uima.annotator.bsf.types;
+
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.jcas.JCasRegistry;
+import org.apache.uima.jcas.cas.TOP_Type;
+
+import org.apache.uima.jcas.tcas.Annotation;
+
+
+/**
+ * Updated by JCasGen Tue Nov 06 10:21:22 CET 2007
+ * XML source: C:/dev/uima/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/BSFExampleTypes.xml
+ * @generated */
+public class Firstname extends Annotation {
+ /** @generated
+ * @ordered
+ */
+ public final static int typeIndexID = JCasRegistry.register(Firstname.class);
+ /** @generated
+ * @ordered
+ */
+ public final static int type = typeIndexID;
+ /** @generated */
+ public int getTypeIndexID() {return typeIndexID;}
+
+ /** Never called. Disable default constructor
+ * @generated */
+ protected Firstname() {}
+
+ /** Internal - constructor used by generator
+ * @generated */
+ public Firstname(int addr, TOP_Type type) {
+ super(addr, type);
+ readObject();
+ }
+
+ /** @generated */
+ public Firstname(JCas jcas) {
+ super(jcas);
+ readObject();
+ }
+
+ /** @generated */
+ public Firstname(JCas jcas, int begin, int end) {
+ super(jcas);
+ setBegin(begin);
+ setEnd(end);
+ readObject();
+ }
+
+ /** <!-- begin-user-doc -->
+ * Write your own initialization here
+ * <!-- end-user-doc -->
+ @generated modifiable */
+ private void readObject() {}
+
+}
+
+
\ No newline at end of file
Added: incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Firstname_Type.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Firstname_Type.java?rev=597458&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Firstname_Type.java (added)
+++ incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Firstname_Type.java Thu Nov 22 09:27:22 2007
@@ -0,0 +1,55 @@
+
+/* First created by JCasGen Tue Nov 06 10:21:22 CET 2007 */
+package org.apache.uima.annotator.bsf.types;
+
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.jcas.JCasRegistry;
+import org.apache.uima.cas.impl.CASImpl;
+import org.apache.uima.cas.impl.FSGenerator;
+import org.apache.uima.cas.FeatureStructure;
+import org.apache.uima.cas.impl.TypeImpl;
+import org.apache.uima.cas.Type;
+import org.apache.uima.jcas.tcas.Annotation_Type;
+
+/**
+ * Updated by JCasGen Tue Nov 06 10:21:22 CET 2007
+ * @generated */
+public class Firstname_Type extends Annotation_Type {
+ /** @generated */
+ protected FSGenerator getFSGenerator() {return fsGenerator;}
+ /** @generated */
+ private final FSGenerator fsGenerator =
+ new FSGenerator() {
+ public FeatureStructure createFS(int addr, CASImpl cas) {
+ if (Firstname_Type.this.useExistingInstance) {
+ // Return eq fs instance if already created
+ FeatureStructure fs = Firstname_Type.this.jcas.getJfsFromCaddr(addr);
+ if (null == fs) {
+ fs = new Firstname(addr, Firstname_Type.this);
+ Firstname_Type.this.jcas.putJfsFromCaddr(addr, fs);
+ return fs;
+ }
+ return fs;
+ } else return new Firstname(addr, Firstname_Type.this);
+ }
+ };
+ /** @generated */
+ public final static int typeIndexID = Firstname.typeIndexID;
+ /** @generated
+ @modifiable */
+ public final static boolean featOkTst = JCasRegistry.getFeatOkTst("org.apache.uima.annotator.bsf.types.Firstname");
+
+
+
+ /** initialize variables to correspond with Cas Type and Features
+ * @generated */
+ public Firstname_Type(JCas jcas, Type casType) {
+ super(jcas, casType);
+ casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator());
+
+ }
+}
+
+
+
+
\ No newline at end of file
Added: incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Nickname.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Nickname.java?rev=597458&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Nickname.java (added)
+++ incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Nickname.java Thu Nov 22 09:27:22 2007
@@ -0,0 +1,96 @@
+
+
+/* First created by JCasGen Tue Nov 06 10:21:22 CET 2007 */
+package org.apache.uima.annotator.bsf.types;
+
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.jcas.JCasRegistry;
+import org.apache.uima.jcas.cas.TOP_Type;
+
+import org.apache.uima.jcas.cas.StringArray;
+
+
+/**
+ * Updated by JCasGen Tue Nov 06 10:21:22 CET 2007
+ * XML source: C:/dev/uima/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/BSFExampleTypes.xml
+ * @generated */
+public class Nickname extends Firstname {
+ /** @generated
+ * @ordered
+ */
+ public final static int typeIndexID = JCasRegistry.register(Nickname.class);
+ /** @generated
+ * @ordered
+ */
+ public final static int type = typeIndexID;
+ /** @generated */
+ public int getTypeIndexID() {return typeIndexID;}
+
+ /** Never called. Disable default constructor
+ * @generated */
+ protected Nickname() {}
+
+ /** Internal - constructor used by generator
+ * @generated */
+ public Nickname(int addr, TOP_Type type) {
+ super(addr, type);
+ readObject();
+ }
+
+ /** @generated */
+ public Nickname(JCas jcas) {
+ super(jcas);
+ readObject();
+ }
+
+ /** @generated */
+ public Nickname(JCas jcas, int begin, int end) {
+ super(jcas);
+ setBegin(begin);
+ setEnd(end);
+ readObject();
+ }
+
+ /** <!-- begin-user-doc -->
+ * Write your own initialization here
+ * <!-- end-user-doc -->
+ @generated modifiable */
+ private void readObject() {}
+
+
+
+ //*--------------*
+ //* Feature: firstnames
+
+ /** getter for firstnames - gets List of possible firstnames related to this nickname
+ * @generated */
+ public StringArray getFirstnames() {
+ if (Nickname_Type.featOkTst && ((Nickname_Type)jcasType).casFeat_firstnames == null)
+ jcasType.jcas.throwFeatMissing("firstnames", "org.apache.uima.annotator.bsf.types.Nickname");
+ return (StringArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Nickname_Type)jcasType).casFeatCode_firstnames)));}
+
+ /** setter for firstnames - sets List of possible firstnames related to this nickname
+ * @generated */
+ public void setFirstnames(StringArray v) {
+ if (Nickname_Type.featOkTst && ((Nickname_Type)jcasType).casFeat_firstnames == null)
+ jcasType.jcas.throwFeatMissing("firstnames", "org.apache.uima.annotator.bsf.types.Nickname");
+ jcasType.ll_cas.ll_setRefValue(addr, ((Nickname_Type)jcasType).casFeatCode_firstnames, jcasType.ll_cas.ll_getFSRef(v));}
+
+ /** indexed getter for firstnames - gets an indexed value - List of possible firstnames related to this nickname
+ * @generated */
+ public String getFirstnames(int i) {
+ if (Nickname_Type.featOkTst && ((Nickname_Type)jcasType).casFeat_firstnames == null)
+ jcasType.jcas.throwFeatMissing("firstnames", "org.apache.uima.annotator.bsf.types.Nickname");
+ jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Nickname_Type)jcasType).casFeatCode_firstnames), i);
+ return jcasType.ll_cas.ll_getStringArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Nickname_Type)jcasType).casFeatCode_firstnames), i);}
+
+ /** indexed setter for firstnames - sets an indexed value - List of possible firstnames related to this nickname
+ * @generated */
+ public void setFirstnames(int i, String v) {
+ if (Nickname_Type.featOkTst && ((Nickname_Type)jcasType).casFeat_firstnames == null)
+ jcasType.jcas.throwFeatMissing("firstnames", "org.apache.uima.annotator.bsf.types.Nickname");
+ jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Nickname_Type)jcasType).casFeatCode_firstnames), i);
+ jcasType.ll_cas.ll_setStringArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Nickname_Type)jcasType).casFeatCode_firstnames), i, v);}
+ }
+
+
\ No newline at end of file
Added: incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Nickname_Type.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Nickname_Type.java?rev=597458&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Nickname_Type.java (added)
+++ incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Nickname_Type.java Thu Nov 22 09:27:22 2007
@@ -0,0 +1,97 @@
+
+/* First created by JCasGen Tue Nov 06 10:21:22 CET 2007 */
+package org.apache.uima.annotator.bsf.types;
+
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.jcas.JCasRegistry;
+import org.apache.uima.cas.impl.CASImpl;
+import org.apache.uima.cas.impl.FSGenerator;
+import org.apache.uima.cas.FeatureStructure;
+import org.apache.uima.cas.impl.TypeImpl;
+import org.apache.uima.cas.Type;
+import org.apache.uima.cas.impl.FeatureImpl;
+import org.apache.uima.cas.Feature;
+
+/**
+ * Updated by JCasGen Tue Nov 06 10:21:22 CET 2007
+ * @generated */
+public class Nickname_Type extends Firstname_Type {
+ /** @generated */
+ protected FSGenerator getFSGenerator() {return fsGenerator;}
+ /** @generated */
+ private final FSGenerator fsGenerator =
+ new FSGenerator() {
+ public FeatureStructure createFS(int addr, CASImpl cas) {
+ if (Nickname_Type.this.useExistingInstance) {
+ // Return eq fs instance if already created
+ FeatureStructure fs = Nickname_Type.this.jcas.getJfsFromCaddr(addr);
+ if (null == fs) {
+ fs = new Nickname(addr, Nickname_Type.this);
+ Nickname_Type.this.jcas.putJfsFromCaddr(addr, fs);
+ return fs;
+ }
+ return fs;
+ } else return new Nickname(addr, Nickname_Type.this);
+ }
+ };
+ /** @generated */
+ public final static int typeIndexID = Nickname.typeIndexID;
+ /** @generated
+ @modifiable */
+ public final static boolean featOkTst = JCasRegistry.getFeatOkTst("org.apache.uima.annotator.bsf.types.Nickname");
+
+ /** @generated */
+ final Feature casFeat_firstnames;
+ /** @generated */
+ final int casFeatCode_firstnames;
+ /** @generated */
+ public int getFirstnames(int addr) {
+ if (featOkTst && casFeat_firstnames == null)
+ jcas.throwFeatMissing("firstnames", "org.apache.uima.annotator.bsf.types.Nickname");
+ return ll_cas.ll_getRefValue(addr, casFeatCode_firstnames);
+ }
+ /** @generated */
+ public void setFirstnames(int addr, int v) {
+ if (featOkTst && casFeat_firstnames == null)
+ jcas.throwFeatMissing("firstnames", "org.apache.uima.annotator.bsf.types.Nickname");
+ ll_cas.ll_setRefValue(addr, casFeatCode_firstnames, v);}
+
+ /** @generated */
+ public String getFirstnames(int addr, int i) {
+ if (featOkTst && casFeat_firstnames == null)
+ jcas.throwFeatMissing("firstnames", "org.apache.uima.annotator.bsf.types.Nickname");
+ if (lowLevelTypeChecks)
+ return ll_cas.ll_getStringArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_firstnames), i, true);
+ jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_firstnames), i);
+ return ll_cas.ll_getStringArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_firstnames), i);
+ }
+
+ /** @generated */
+ public void setFirstnames(int addr, int i, String v) {
+ if (featOkTst && casFeat_firstnames == null)
+ jcas.throwFeatMissing("firstnames", "org.apache.uima.annotator.bsf.types.Nickname");
+ if (lowLevelTypeChecks)
+ ll_cas.ll_setStringArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_firstnames), i, v, true);
+ jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_firstnames), i);
+ ll_cas.ll_setStringArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_firstnames), i, v);
+ }
+
+
+
+
+ /** initialize variables to correspond with Cas Type and Features
+ * @generated */
+ public Nickname_Type(JCas jcas, Type casType) {
+ super(jcas, casType);
+ casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator());
+
+
+ casFeat_firstnames = jcas.getRequiredFeatureDE(casType, "firstnames", "uima.cas.StringArray", featOkTst);
+ casFeatCode_firstnames = (null == casFeat_firstnames) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_firstnames).getCode();
+
+ }
+}
+
+
+
+
\ No newline at end of file
Added: incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Token.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Token.java?rev=597458&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Token.java (added)
+++ incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Token.java Thu Nov 22 09:27:22 2007
@@ -0,0 +1,62 @@
+
+
+/* First created by JCasGen Tue Nov 06 10:21:21 CET 2007 */
+package org.apache.uima.annotator.bsf.types;
+
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.jcas.JCasRegistry;
+import org.apache.uima.jcas.cas.TOP_Type;
+
+import org.apache.uima.jcas.tcas.Annotation;
+
+
+/**
+ * Updated by JCasGen Tue Nov 06 10:21:22 CET 2007
+ * XML source: C:/dev/uima/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/BSFExampleTypes.xml
+ * @generated */
+public class Token extends Annotation {
+ /** @generated
+ * @ordered
+ */
+ public final static int typeIndexID = JCasRegistry.register(Token.class);
+ /** @generated
+ * @ordered
+ */
+ public final static int type = typeIndexID;
+ /** @generated */
+ public int getTypeIndexID() {return typeIndexID;}
+
+ /** Never called. Disable default constructor
+ * @generated */
+ protected Token() {}
+
+ /** Internal - constructor used by generator
+ * @generated */
+ public Token(int addr, TOP_Type type) {
+ super(addr, type);
+ readObject();
+ }
+
+ /** @generated */
+ public Token(JCas jcas) {
+ super(jcas);
+ readObject();
+ }
+
+ /** @generated */
+ public Token(JCas jcas, int begin, int end) {
+ super(jcas);
+ setBegin(begin);
+ setEnd(end);
+ readObject();
+ }
+
+ /** <!-- begin-user-doc -->
+ * Write your own initialization here
+ * <!-- end-user-doc -->
+ @generated modifiable */
+ private void readObject() {}
+
+}
+
+
\ No newline at end of file
Added: incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Token_Type.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Token_Type.java?rev=597458&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Token_Type.java (added)
+++ incubator/uima/sandbox/trunk/BSFAnnotator/src/main/java/org/apache/uima/annotator/bsf/types/Token_Type.java Thu Nov 22 09:27:22 2007
@@ -0,0 +1,55 @@
+
+/* First created by JCasGen Tue Nov 06 10:21:22 CET 2007 */
+package org.apache.uima.annotator.bsf.types;
+
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.jcas.JCasRegistry;
+import org.apache.uima.cas.impl.CASImpl;
+import org.apache.uima.cas.impl.FSGenerator;
+import org.apache.uima.cas.FeatureStructure;
+import org.apache.uima.cas.impl.TypeImpl;
+import org.apache.uima.cas.Type;
+import org.apache.uima.jcas.tcas.Annotation_Type;
+
+/**
+ * Updated by JCasGen Tue Nov 06 10:21:22 CET 2007
+ * @generated */
+public class Token_Type extends Annotation_Type {
+ /** @generated */
+ protected FSGenerator getFSGenerator() {return fsGenerator;}
+ /** @generated */
+ private final FSGenerator fsGenerator =
+ new FSGenerator() {
+ public FeatureStructure createFS(int addr, CASImpl cas) {
+ if (Token_Type.this.useExistingInstance) {
+ // Return eq fs instance if already created
+ FeatureStructure fs = Token_Type.this.jcas.getJfsFromCaddr(addr);
+ if (null == fs) {
+ fs = new Token(addr, Token_Type.this);
+ Token_Type.this.jcas.putJfsFromCaddr(addr, fs);
+ return fs;
+ }
+ return fs;
+ } else return new Token(addr, Token_Type.this);
+ }
+ };
+ /** @generated */
+ public final static int typeIndexID = Token.typeIndexID;
+ /** @generated
+ @modifiable */
+ public final static boolean featOkTst = JCasRegistry.getFeatOkTst("org.apache.uima.annotator.bsf.types.Token");
+
+
+
+ /** initialize variables to correspond with Cas Type and Features
+ * @generated */
+ public Token_Type(JCas jcas, Type casType) {
+ super(jcas, casType);
+ casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator());
+
+ }
+}
+
+
+
+
\ No newline at end of file
Added: incubator/uima/sandbox/trunk/BSFAnnotator/src/main/resources/org/apache/uima/annotator/bsf/BSFAnnotatorMessages.properties
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/src/main/resources/org/apache/uima/annotator/bsf/BSFAnnotatorMessages.properties?rev=597458&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/BSFAnnotator/src/main/resources/org/apache/uima/annotator/bsf/BSFAnnotatorMessages.properties (added)
+++ incubator/uima/sandbox/trunk/BSFAnnotator/src/main/resources/org/apache/uima/annotator/bsf/BSFAnnotatorMessages.properties Thu Nov 22 09:27:22 2007
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+bsf_annotator_resource_not_found = "The resource file {0} could not be found."
+bsf_annotator_language_not_supported = "The scripting language {0} is not supported."
+bsf_annotator_error_reading_script = "Error while reading the script {0}."
+bsf_annotator_error_executing_script = "Error while executing the script {0}."
+bsf_annotator_error_calling_method = "Error while calling method {0}."
Added: incubator/uima/sandbox/trunk/BSFAnnotator/src/main/resources/org/apache/uima/annotator/bsf/BSFAnnotatorMessages_fr.properties
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/BSFAnnotator/src/main/resources/org/apache/uima/annotator/bsf/BSFAnnotatorMessages_fr.properties?rev=597458&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/BSFAnnotator/src/main/resources/org/apache/uima/annotator/bsf/BSFAnnotatorMessages_fr.properties (added)
+++ incubator/uima/sandbox/trunk/BSFAnnotator/src/main/resources/org/apache/uima/annotator/bsf/BSFAnnotatorMessages_fr.properties Thu Nov 22 09:27:22 2007
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+bsf_annotator_resource_not_found = "Le fichier de ressource {0} est introuvable."
+bsf_annotator_language_not_supported = "Le langage de script {0} n est pas supporté."
+bsf_annotator_error_reading_script = "Une erreur est survenue lors de la lecture du script {0}."
+bsf_annotator_error_executing_script = "Une erreur est survenue lors de l exécution du script {0}."
+bsf_annotator_error_calling_method = "Une erreur est survenue lors de l appel à la méthode {0}."