<commit_before>/**
 * 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 at.illecker.storm.examples.util;

import java.io.File;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

public class Configuration {

  public static final boolean LOGGING = false;

  public static final String MODEL_PATH = "resources" + File.separator
      + "models";

  public static final String WORD_LIST_PATH = "resources" + File.separator
      + "wordlists";

  public static final String WORD_NET_PATH = "resources" + File.separator
      + "wordnet";

  public static final String DATASET_PATH = "resources" + File.separator
      + "datasets";

  public static final String USER_DIR_PATH = ((System.getProperty("user.dir") != null) ? System
      .getProperty("user.dir") : "");

  public static final String TEMP_DIR_PATH = System
      .getProperty("java.io.tmpdir");

  public static Map<String, Properties> getWordlists() {
    String wordListDir = USER_DIR_PATH + File.separator + WORD_LIST_PATH
        + File.separator;
    Map<String, Properties> wordLists = new HashMap<String, Properties>();

    // Add AFINN word list using Regex = false
    // AFINN word list (minValue -5 and maxValue +5)
    Properties props = new Properties();
    props.put("separator", "\t");
    props.put("containsRegex", Boolean.valueOf(false));
    props.put("featureScaling", Boolean.valueOf(true));
    props.put("minValue", Double.valueOf(-5));
    props.put("maxValue", Double.valueOf(5));
    wordLists.put(wordListDir + "AFINN-111.txt", props);

    // Add SentStrength EmoticonLookupTable using Regex = false
    // SentStrength emoticons (minValue -1 and maxValue +1)
    props = new Properties();
    props.put("separator", "\t");
    props.put("containsRegex", Boolean.valueOf(false));
    props.put("featureScaling", Boolean.valueOf(true));
    props.put("minValue", Double.valueOf(-1));
    props.put("maxValue", Double.valueOf(1));

    wordLists.put(wordListDir
        + "SentStrength_Data_Sept2011_EmoticonLookupTable.txt", props);

    // Add SentStrength EmotionLookupTable using Regex = true
    // SentStrength word list (minValue -5 and maxValue +5)
    props = new Properties();
    props.put("separator", "\t");
    props.put("containsRegex", Boolean.valueOf(true));
    props.put("featureScaling", Boolean.valueOf(true));
    props.put("minValue", Double.valueOf(-5));
    props.put("maxValue", Double.valueOf(5));
    wordLists.put(wordListDir
        + "SentStrength_Data_Sept2011_EmotionLookupTable.txt", props);

    return wordLists;
  }

  public static Map<String, Properties> getSlangWordlists() {
    String wordListDir = USER_DIR_PATH + File.separator + WORD_LIST_PATH
        + File.separator;
    Map<String, Properties> slangWordLists = new HashMap<String, Properties>();
    Properties props;

    // Add noslang.txt from http://www.noslang.com/dictionary/
    props = new Properties();
    props.put("separator", "\t");
    slangWordLists.put(wordListDir + "noslang.txt", props);

    // Add GATE SlangLookupTable orth.en
    props = new Properties();
    props.put("separator", ",");
    slangWordLists.put(wordListDir + "GATE_slang.en.csv", props);

    // Add SentStrength SlangLookupTable
    props = new Properties();
    props.put("separator", "\t");
    slangWordLists.put(wordListDir<commit_msg>Add InternetSlang to Config<commit_after>/**
 * 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 at.illecker.storm.examples.util;

import java.io.File;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

public class Configuration {

  public static final boolean LOGGING = false;

  public static final String MODEL_PATH = "resources" + File.separator
      + "models";

  public static final String WORD_LIST_PATH = "resources" + File.separator
      + "wordlists";

  public static final String WORD_NET_PATH = "resources" + File.separator
      + "wordnet";

  public static final String DATASET_PATH = "resources" + File.separator
      + "datasets";

  public static final String USER_DIR_PATH = ((System.getProperty("user.dir") != null) ? System
      .getProperty("user.dir") : "");

  public static final String TEMP_DIR_PATH = System
      .getProperty("java.io.tmpdir");

  public static Map<String, Properties> getWordlists() {
    String wordListDir = USER_DIR_PATH + File.separator + WORD_LIST_PATH
        + File.separator;
    Map<String, Properties> wordLists = new HashMap<String, Properties>();

    // Add AFINN word list using Regex = false
    // AFINN word list (minValue -5 and maxValue +5)
    Properties props = new Properties();
    props.put("separator", "\t");
    props.put("containsRegex", Boolean.valueOf(false));
    props.put("featureScaling", Boolean.valueOf(true));
    props.put("minValue", Double.valueOf(-5));
    props.put("maxValue", Double.valueOf(5));
    wordLists.put(wordListDir + "AFINN-111.txt", props);

    // Add SentStrength EmoticonLookupTable using Regex = false
    // SentStrength emoticons (minValue -1 and maxValue +1)
    props = new Properties();
    props.put("separator", "\t");
    props.put("containsRegex", Boolean.valueOf(false));
    props.put("featureScaling", Boolean.valueOf(true));
    props.put("minValue", Double.valueOf(-1));
    props.put("maxValue", Double.valueOf(1));

    wordLists.put(wordListDir
        + "SentStrength_Data_Sept2011_EmoticonLookupTable.txt", props);

    // Add SentStrength EmotionLookupTable using Regex = true
    // SentStrength word list (minValue -5 and maxValue +5)
    props = new Properties();
    props.put("separator", "\t");
    props.put("containsRegex", Boolean.valueOf(true));
    props.put("featureScaling", Boolean.valueOf(true));
    props.put("minValue", Double.valueOf(-5));
    props.put("maxValue", Double.valueOf(5));
    wordLists.put(wordListDir
        + "SentStrength_Data_Sept2011_EmotionLookupTable.txt", props);

    return wordLists;
  }

  public static Map<String, Properties> getSlangWordlists() {
    String wordListDir = USER_DIR_PATH + File.separator + WORD_LIST_PATH
        + File.separator;
    Map<String, Properties> slangWordLists = new HashMap<String, Properties>();
    Properties props;

    // Add InternetSlang.txt from http://www.internetslang.com/
    props = new Properties();
    props.put("separator", "\t");
    slangWordLists.put(wordListDir + "InternetSlang.txt", props);

    // Add NoSlang.txt from http://www.noslang.com/dictionary/
    props = new Properties();
    props.put("separator", "\t");
    slangWordLists.put(wordListDir + "NoSlang.txt", props);

    // Add GATE SlangLookupTable orth.en
    props = new Properties();
    props.put("separator", ",");
    slangWordLists.put(wordListDir + "GATE_slang.en.csv", props);

    // Add SentStrength SlangLookupTable
    props = new Properties();
    props.put("separator", "\t");
    slangWordLists.put(wordListDir
{'fraction_non_alphanumeric': 0.11951535113516057, 'fraction_numerical': 0.006352193859545936, 'mean_word_length': 3.858285714285714, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 5, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1460778', 'n_tokens_mistral': 2538, 'n_tokens_neox': 2415, 'n_words': 704}