当前位置: 首页>>代码示例>>Python>>正文


Python quotations.extract_from_plain函数代码示例

本文整理汇总了Python中talon.quotations.extract_from_plain函数的典型用法代码示例。如果您正苦于以下问题:Python extract_from_plain函数的具体用法?Python extract_from_plain怎么用?Python extract_from_plain使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了extract_from_plain函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_link_breaks_quotation_markers_sequence

def test_link_breaks_quotation_markers_sequence():
    # link starts and ends on the same line
    msg_body = """Blah

On Thursday, October 25, 2012 at 3:03 PM, life is short. on Bob wrote:

>
> Post a response by replying to this email
>
 (http://example.com/c/YzOTYzMmE) >
> life is short. (http://example.com/c/YzMmE)
>
"""
    eq_("Blah", quotations.extract_from_plain(msg_body))

    # link starts after some text on one line and ends on another
    msg_body = """Blah

On Monday, 24 September, 2012 at 3:46 PM, bob wrote:

> [Ticket #50] test from bob
>
> View ticket (http://example.com/action
_nonce=3dd518)
>
"""
    eq_("Blah", quotations.extract_from_plain(msg_body))
开发者ID:digideskio,项目名称:talon,代码行数:27,代码来源:text_quotations_test.py

示例2: test_pattern_original_message

def test_pattern_original_message():
    msg_body = """Test reply

-----Original Message-----

Test"""

    eq_("Test reply", quotations.extract_from_plain(msg_body))

    msg_body = """Test reply

 -----Original Message-----

Test"""

    eq_("Test reply", quotations.extract_from_plain(msg_body))

    msg_body = """Test reply

 -----Urspr=C3=BCngliche Nachricht-----

Test"""

    eq_("Test reply", quotations.extract_from_plain(msg_body))

    msg_body = u"""Test reply

 -----Ursprüngliche Nachricht-----

Test"""

    eq_("Test reply", quotations.extract_from_plain(msg_body))
开发者ID:sspross,项目名称:talon,代码行数:32,代码来源:text_quotations_test.py

示例3: test_appointment

def test_appointment():
    msg_body = """Response

10/19/2017 @ 9:30 am for physical therapy
Bla
1517 4th Avenue Ste 300
London CA 19129, 555-421-6780

John Doe, FCLS
Mailgun Inc
555-941-0697

From: [email protected] [mailto:[email protected]]
Sent: Wednesday, October 18, 2017 2:05 PM
To: John Doer - SIU <[email protected]>
Subject: RE: Claim # 5551188-1

Text"""

    expected = """Response

10/19/2017 @ 9:30 am for physical therapy
Bla
1517 4th Avenue Ste 300
London CA 19129, 555-421-6780

John Doe, FCLS
Mailgun Inc
555-941-0697"""
    eq_(expected, quotations.extract_from_plain(msg_body))
开发者ID:mailgun,项目名称:talon,代码行数:30,代码来源:text_quotations_test.py

示例4: test_short_quotation

def test_short_quotation():
    msg_body = """Hi

On 04/19/2011 07:10 AM, Roman Tkachenko wrote:

> Hello"""
    eq_("Hi", quotations.extract_from_plain(msg_body))
开发者ID:digideskio,项目名称:talon,代码行数:7,代码来源:text_quotations_test.py

示例5: _check_pattern_original_message

def _check_pattern_original_message(original_message_indicator):
    msg_body = u"""Test reply

-----{}-----

Test"""
    eq_('Test reply', quotations.extract_from_plain(msg_body.format(six.text_type(original_message_indicator))))
开发者ID:digideskio,项目名称:talon,代码行数:7,代码来源:text_quotations_test.py

示例6: test_reply_after_quotations

def test_reply_after_quotations():
    msg_body = """On 04/19/2011 07:10 AM, Roman Tkachenko wrote:

>
> Test
Test reply"""
    eq_("Test reply", quotations.extract_from_plain(msg_body))
开发者ID:digideskio,项目名称:talon,代码行数:7,代码来源:text_quotations_test.py

示例7: test_pattern_original_message

def test_pattern_original_message():
    msg_body = """Test reply

-----Original Message-----

Test"""

    eq_("Test reply", quotations.extract_from_plain(msg_body))

    msg_body = """Test reply

 -----Original Message-----

Test"""

    eq_("Test reply", quotations.extract_from_plain(msg_body))
开发者ID:CatalinBraescu,项目名称:talon,代码行数:16,代码来源:text_quotations_test.py

示例8: test_french_from_block

def test_french_from_block():
    eq_('Lorem ipsum', quotations.extract_from_plain(
    u"""Lorem ipsum

Le 23 janv. 2015 à 22:03, Brendan xxx <[email protected]<mailto:[email protected]>> a écrit:

Bonjour!"""))
开发者ID:digideskio,项目名称:talon,代码行数:7,代码来源:text_quotations_test.py

示例9: test_norwegian_from_line

def test_norwegian_from_line():
    eq_('Lorem', quotations.extract_from_plain(
    u"""Lorem
På 14 september 2015 på 02:23:18, Valentino Rudy ([email protected]) skrev:

Veniam laborum mlkshk kale chips authentic. Normcore mumblecore laboris, fanny pack readymade eu blog chia pop-up freegan enim master cleanse.
"""))
开发者ID:digideskio,项目名称:talon,代码行数:7,代码来源:text_quotations_test.py

示例10: test_too_many_lines

def test_too_many_lines():
    msg_body = """Test reply
Hi
-----Original Message-----

Test"""
    eq_("Test reply", quotations.extract_from_plain(msg_body))
开发者ID:digideskio,项目名称:talon,代码行数:7,代码来源:text_quotations_test.py

示例11: test_with_indent

def test_with_indent():
    msg_body = """YOLO salvia cillum kogi typewriter mumblecore cardigan skateboard Austin.

------On 12/29/1987 17:32 PM, Julius Caesar wrote-----

Brunch mumblecore pug Marfa tofu, irure taxidermy hoodie readymade pariatur. 
    """
    eq_("YOLO salvia cillum kogi typewriter mumblecore cardigan skateboard Austin.", quotations.extract_from_plain(msg_body))
开发者ID:digideskio,项目名称:talon,代码行数:8,代码来源:text_quotations_test.py

示例12: test_vietnamese_from_block

def test_vietnamese_from_block():
    eq_('Hello', quotations.extract_from_plain(
    u"""Hello

Vào 14:24 8 tháng 6, 2017, Hùng Nguyễn <[email protected]> đã viết:

> Xin chào
"""))
开发者ID:mailgun,项目名称:talon,代码行数:8,代码来源:text_quotations_test.py

示例13: test_from_block_starts_with_date

def test_from_block_starts_with_date():
    msg_body = """Blah

Date: Wed, 16 May 2012 00:15:02 -0600
To: [email protected]

"""
    eq_('Blah', quotations.extract_from_plain(msg_body))
开发者ID:mailgun,项目名称:talon,代码行数:8,代码来源:text_quotations_test.py

示例14: test_dutch_from_block

def test_dutch_from_block():
    eq_('Gluten-free culpa lo-fi et nesciunt nostrud.', quotations.extract_from_plain(
    """Gluten-free culpa lo-fi et nesciunt nostrud. 

Op 17-feb.-2015, om 13:18 heeft Julius Caesar <[email protected]> het volgende geschreven:
    
Small batch beard laboris tempor, non listicle hella Tumblr heirloom. 
"""))
开发者ID:digideskio,项目名称:talon,代码行数:8,代码来源:text_quotations_test.py

示例15: test_pattern_on_date_wrote_somebody

def test_pattern_on_date_wrote_somebody():
    eq_('Lorem', quotations.extract_from_plain(
    """Lorem

Op 13-02-2014 3:18 schreef Julius Caesar <[email protected]>:
    
Veniam laborum mlkshk kale chips authentic. Normcore mumblecore laboris, fanny pack readymade eu blog chia pop-up freegan enim master cleanse.
"""))
开发者ID:digideskio,项目名称:talon,代码行数:8,代码来源:text_quotations_test.py


注:本文中的talon.quotations.extract_from_plain函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。