secondary-source-triggers.corenlp 1016 Bytes
Newer Older
Bertrand Goupil's avatar
Bertrand Goupil committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
# Map variable names to annotation keys
tokens = { type: "CLASS", value: "edu.stanford.nlp.ling.CoreAnnotations$TokensAnnotation" }

$Triggers = (
   /communiqué/ | 
   /presse/ |
   /conférence/ /de/ /presse/ | 
   /interview/ |
   /télévision/ | 
   /agence/ |
   /journaliste/ |
   /journalistes/ |
   /quotidien/ |
   /hebdomadaire/ |
   /mensuel/ |
   /entretien/ |
   /TV/ |
   /source/ |
   /média/ |
   /médias/ |
   /enquêteur/ |
   /enquêteurs/ |
   /site/ |
   /blog/ |
   /tweeté/ |
   /tweetant/ |
   /tweet/ |
   /tribune/ |
   /texte/ |
   /table/ /ronde/ |
   /lettre/ |
   /rumeur/ |
   /rumeurs/ |
   /rapport/ |
   /propos/ |
   /enquête/ |
   /journal/ |
   /discours/ |
   /déclaration/ |
   /courrier/ |
   /comptage/ 
)

# Define ruleType to be over tokens
ENV.defaults["ruleType"] = "tokens"
ENV.defaultResultAnnotationKey = tokens

{
    ruleType: "tokens",
    pattern: ( $Triggers ),
    action: ( Annotate($0, tokens, "SEC_SOURCE_TRIGGER")),
    result: "SEC_SOURCE_TRIGGER"
}