Creating a New Topic/Activity in VIEW ====================================== Creating a new topic is a little complicated. First off, the terminology can potentially be confusing, so to clarify: - topic: the grammar topic being presented, e.g., determiners - activity: the type of presentation, e.g., colorize, click, multiple choice, practice Unfortunately, we haven't always used these names correctly in the directory structure, but we'll try to use them consistently in the instructions below. It's easiest to start out with a copy of an existing topic and modify it gradually. In the first section, we'll start out by modifying a copy of the Determiners topic that annotates prepositions instead of determiners. This involves adding a new topic to the web interface and firefox add-on, but doesn't yet involve new annotators. The second section will discuss how to add new annotators and the third section will discuss how to modify the activities. Update: By now, a prepositions topic already exists. So, by following the steps below, you would override the exitsing code. This is not a problem if you only want to get familiar with VIEW. In this case, just check out VIEW from SVN another time and use one working copy for playing around (but never committing your changes) and the other for actual development. How to create a new Topic for Russian ------------------------------------- We're going to make a copy of the Russian noun singular topic and modify it to highlight Russian noun plural instead. 1. Make a copy of the topic specification: Make a copy of the RusNounSingular directory in 'src/main/webapp/activities/RusNounSingular' called 'src/main/webapp/activities/RusNounPlural'. (Yes, this directory should actually be called "topics" to line up with the terminology above.) 2. Edit 'src/main/webapp/activities/RusNounPlural/activity.xml' a. Change the of the topic to "Russian Noun Plural". b. Change to 3. Edit 'src/main/webapp/activities/RusNounPlural/help.jsp' for the new topic. a. Change the header

to RusNounPlural b. Replace all occurrences of the old topic with the new topic. 4. Make a copy of the descriptors used for the new topic. a. Make a copy of vislcg3RusNounSingularPipe.xml in '/desc/operators/vislcg3RusNounSingularPipe.xml' called vislcg3RusNounPluralPipe (as specified in activity.xml earlier) Change to Change vislcg3PostProc_RusNounSingular/Tags to vislcg3PostProc_RusNounPlural/Tags Change vislcg3RusNounSingularPipe to vislcg3RusNounPluralPipe Change vislcg3PostProc_RusNounSingular to vislcg3PostProc_RusNounPlural b. Make a copy of vislcg3PostProc_RusNounSingular.xml in '/desc/operators/vislcg3PostProc_RusNounSingular.xml' called vislcg3PostProc_RusNounPlural.xml Change to Change vislcg3PostProc_RusNounSingular to vislcg3PostProc_RusNounPlural Change vislcg3RusNounSingularEnhancer to vislcg3RusNounPluralEnhancer c. Make a copy of vislcg3RusNounSingularEnhancer.xml in '/desc/enhancers/vislcg3RusNounSingularEnhancer.xml' called vislcg3RusNounPluralEnhancer.xml Change werti.uima.enhancer.Vislcg3RusNounSingularEnhancer to werti.uima.enhancer.Vislcg3RusNounPluralEnhancer Change vislcg3RusNounSingularEnhancer to vislcg3RusNounPluralEnhancer 5. Make a copy of the enhancer java class used for the new topic. a. Make a copy of Vislcg3RusNounSingularEnhancer.java in '/src/main/java/werti/uima/enhancer/Vislcg3RusNounSingularEnhancer.java' called Vislcg3RusNounPluralEnhancer.java b. Change the class description according to the new topic (replace singular with plural), it does not hurt to read it too. c. Go to the process(JCas cas) method and change the patterns to your liking. We will simply replace the number pattern Sg with Pl d. Depending on the topic more changes need to be made in here (e.g. distractor generation) 6. Create a new topic in the VIEW firefox extension a. Make a copy of rusnounsingular.js in '/src/main/resources/firefox-extension/view/chrome/content/rusnounsingular.js' called rusnounplural.js (it is very important to take the lowercase version of the directoryname chosen in step #1!) b. Change the class name wertiview.rusnounsingular = { to wertiview.rusnounplural = { c. Replace every occurrence of colorizeStyleRusNounSingular with colorizeStyleRusNounPlural (as the topic directory is called RusNounPlural) d. Replace every occurrence of rusnounsingular with rusnounplural (as the javascript class is called rusnounplural.js) e. Add the colorize styles to 'src/main/resources/firefox-extension/view/chrome/content/view.css'. Just search for the style of colorizeStyleRusNounSingular Make a copy and rename it to colorizeStyleRusNounPlural Don't forget to change the description to plural, too. 7. Add the new topic to the VIEW toolbar a. Edit browser.xul in '/src/main/resources/firefox-extension/view/chrome/content/browser.xul'to tell the add-on to load our new topic. Make a copy of