コード例 #1
0
ファイル: preprocess_test.py プロジェクト: mikaelbr/tweetsa
    def test_negation_attachment(self):
        t1 = p.negation_attachment("This is not perfect at all!")
        t2 = p.negation_attachment("I am not!!")
        t3 = p.negation_attachment("I'm not!!")
        t4 = p.negation_attachment("I am not short")

        self.assertEqual(t1, "This is-not not-perfect at all!")
        self.assertEqual(t2, "I am-not!!")
        self.assertEqual(t3, "I'm-not!!")
        self.assertEqual(t4, "I am-not not-short")
コード例 #2
0
    def test_negation_attachment(self):
        t1 = p.negation_attachment("This is not perfect at all!")
        t2 = p.negation_attachment("I am not!!")
        t3 = p.negation_attachment("I'm not!!")
        t4 = p.negation_attachment("I am not short")

        self.assertEqual(t1, "This is-not not-perfect at all!")
        self.assertEqual(t2, "I am-not!!")
        self.assertEqual(t3, "I'm-not!!")
        self.assertEqual(t4, "I am-not not-short")
コード例 #3
0
ファイル: preprocessor.py プロジェクト: mikaelbr/tweetsa
def method2(text):
  text = f.no_url(text)
  text = f.no_usernames(text)
  text = f.reduce_letter_duplicates(text)
  # text = p.remove_stopwords(text, ['not'])
  text = p.negation_attachment(text)
  return text
コード例 #4
0
ファイル: preprocessor.py プロジェクト: mikaelbr/tweetsa
def method2(text):
    text = f.no_url(text)
    text = f.no_usernames(text)
    text = f.reduce_letter_duplicates(text)
    # text = p.remove_stopwords(text, ['not'])
    text = p.negation_attachment(text)
    return text
コード例 #5
0
def all(text):
  text = text.lower()
  text = f.no_url(text)
  text = f.no_usernames(text)
  text = f.no_emoticons(text)
  text = f.no_hash(text)
  text = f.no_rt_tag(text)
  text = f.reduce_letter_duplicates(text)
  text = p.negation_attachment(text)

  return text
コード例 #6
0
def all(text):
    text = text.lower()
    text = f.no_url(text)
    text = f.no_usernames(text)
    text = f.no_emoticons(text)
    text = f.no_hash(text)
    text = f.no_rt_tag(text)
    text = f.reduce_letter_duplicates(text)
    text = p.negation_attachment(text)

    return text
コード例 #7
0
ファイル: example.py プロジェクト: mikaelbr/tweetsa
def add_filters (text):
  text = f.no_url(text)
  # text = f.username_placeholder(text)
  text = f.no_usernames(text)
  # text = f.no_emoticons(text)
  text = f.no_hash(text)
  # text = f.no_rt_tag(text)
  text = f.reduce_letter_duplicates(text)
  # text = p.remove_stopwords(text, ['not'])
  text = p.negation_attachment(text)

  return text
コード例 #8
0
ファイル: example.py プロジェクト: mikaelbr/tweetsa
def add_filters(text):
    text = f.no_url(text)
    # text = f.username_placeholder(text)
    text = f.no_usernames(text)
    # text = f.no_emoticons(text)
    text = f.no_hash(text)
    # text = f.no_rt_tag(text)
    text = f.reduce_letter_duplicates(text)
    # text = p.remove_stopwords(text, ['not'])
    text = p.negation_attachment(text)

    return text
コード例 #9
0
def no_url_usernames_reduced_attached(text):
  text = f.no_url(text)
  text = f.no_usernames(text)
  text = f.reduce_letter_duplicates(text)
  text = p.negation_attachment(text)
  return text
コード例 #10
0
def reduced_attached(text):
  text = f.reduce_letter_duplicates(text)
  text = p.negation_attachment(text)
  return text
コード例 #11
0
def no_url_usernames_reduced_attached(text):
    text = f.no_url(text)
    text = f.no_usernames(text)
    text = f.reduce_letter_duplicates(text)
    text = p.negation_attachment(text)
    return text
コード例 #12
0
def reduced_attached(text):
    text = f.reduce_letter_duplicates(text)
    text = p.negation_attachment(text)
    return text