• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python tools.existence_check函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: check_midnight_noon

def check_midnight_noon(text):
    """Check the text."""
    err = "garner.am_pm.midnight_noon"
    msg = (u"12 a.m. and 12 p.m. are wrong and confusing."
           " Use 'midnight' or 'noon'.")

    return existence_check(text, ["12 ?[ap]\.?m\.?"], err, msg)
开发者ID:Uran198,项目名称:proselint,代码行数:7,代码来源:am_pm.py


示例2: check_copyright_symbol

def check_copyright_symbol(text):
    """Use the copyright symbol instead of (c)."""
    err = "butterick.symbols.copyright"
    msg = u"(c) is a goofy alphabetic approximation, use the symbol ©."
    regex = "\([cC]\)"

    return existence_check(text, [regex], err, msg, max_errors=1, require_padding=False)
开发者ID:Uran198,项目名称:proselint,代码行数:7,代码来源:symbols.py


示例3: check

def check(text):
    """Check the text."""
    err = "misc.chatspeak"
    msg = u"'{}' is chatspeak. Write it out."

    words = [
        "2day",
        "4U",
        "AFAIK",
        "AFK",
        "AFK",
        "ASAP",
        "B4",
        "brb",
        "btw",
        "cya",
        "GR8",
        "lol",
        "LOL",
        "LUV",
        "OMG",
        "rofl",
        "roftl",
        "sum1",
        "SWAK",
        "THNX",
        "THX",
        "TTYL",
        "XOXO"
    ]

    return existence_check(text, words, err, msg)
开发者ID:ComSecNinja,项目名称:proselint,代码行数:32,代码来源:chatspeak.py


示例4: check_registered_trademark_symbol

def check_registered_trademark_symbol(text):
    """Use the registered trademark symbol instead of (R)."""
    err = "butterick.symbols.trademark"
    msg = u"(R) is a goofy alphabetic approximation, use the symbol ®."
    regex = "\([rR]\)"

    return existence_check(text, [regex], err, msg, max_errors=3, require_padding=False)
开发者ID:Uran198,项目名称:proselint,代码行数:7,代码来源:symbols.py


示例5: check

def check(text):
    """Check the text."""
    err = "garner.oxymorons"
    msg = u"'{}' is an oxymoron."

    oxymorons = [
        "amateur expert",
        "increasingly less",
        "advancing backwards?",
        "alludes explicitly to",
        "explicitly alludes to",
        "totally obsolescent",
        "completely obsolescent",
        "generally always",
        "usually always",
        "increasingly less",
        "build down",
        "conspicuous absence",
        "exact estimate",
        "executive secretary",
        "found missing",
        "intense apathy",
        "mandatory choice",
        "nonworking mother",
        "organized mess",
        # "pretty ugly",
        # "sure bet",
    ]

    return existence_check(text, oxymorons, err, msg, offset=1, join=True)
开发者ID:ComSecNinja,项目名称:proselint,代码行数:30,代码来源:oxymorons.py


示例6: check_repeated_exclamations

def check_repeated_exclamations(text):
    """Check the text."""
    err = "inc.corporate_speak"
    msg = u"Minimize your use of corporate catchphrases like this one."

    list = [
        "at the end of the day",
        "back to the drawing board",
        "hit the ground running",
        "get the ball rolling",
        "low-hanging fruit",
        "thrown under the bus",
        "think outside the box",
        "let's touch base",
        "get my manager's blessing",
        "it's on my radar",
        "ping me",
        "i don't have the bandwidth",
        "no brainer",
        "par for the course",
        "bang for your buck",
        "synergy",
        "move the goal post",
        "apples to apples",
        "win-win",
        "circle back around",
        "all hands on deck",
        "take this offline",
        "drill-down",
        "elephant in the room",
        "on my plate",
    ]

    return existence_check(text, list, err, msg, ignore_case=True)
开发者ID:ComSecNinja,项目名称:proselint,代码行数:34,代码来源:corporate_speak.py


示例7: check_sentence_spacing

def check_sentence_spacing(text):
    """Use no more than two spaces after a period."""
    err = "butterick.symbols.sentence_spacing"
    msg = u"More than two spaces after the period; use 1 or 2."
    regex = "\. {3}"

    return existence_check(text, [regex], err, msg, max_errors=3, require_padding=False)
开发者ID:Uran198,项目名称:proselint,代码行数:7,代码来源:symbols.py


示例8: check_ellipsis

def check_ellipsis(text):
    """Use an ellipsis instead of three dots."""
    err = "butterick.symbols.ellipsis"
    msg = u"'...' is an approximation, use the ellipsis symbol '…'."
    regex = "\.\.\."

    return existence_check(text, [regex], err, msg, max_errors=3, require_padding=False, offset=0)
开发者ID:Uran198,项目名称:proselint,代码行数:7,代码来源:symbols.py


示例9: check

def check(text):
    """Check the text."""
    err = "garner.commercialese"
    msg = u"'{}' is commercialese."

    commercialese = [
        "acknowledging yours of",
        "beg to advise",
        "enclosed herewith",
        "enclosed please find",
        "further to yours of",
        "further to your letter",
        "in regard to",
        "inst\.",
        "in the amount of",
        "of even date",
        "pending receipt of",
        "please be advised that",
        "please return same",
        "pleasure of a reply",
        "prox\.",
        "pursuant to your request",
        "regarding the matter",
        "regret to inform",
        "thanking you in advance",
        "the undersigned",
        "this acknowledges your letter",
        "ult\."
        "we are pleased to note",
        "with regard to",
        "your favor has come to hand",
        "yours of even date"
    ]

    return existence_check(text, commercialese, err, msg, join=True)
开发者ID:Uran198,项目名称:proselint,代码行数:35,代码来源:commercialese.py


示例10: check_multiplication_symbol

def check_multiplication_symbol(text):
    u"""Use the multiplication symbol ×, not the lowercase letter x."""
    err = "butterick.symbols.multiplication_symbol"
    msg = u"Use the multiplication symbol ×, not the letter x."
    regex = "[0-9]+ ?x ?[0-9]+"

    return existence_check(
        text, [regex], err, msg, max_errors=3, require_padding=False)
开发者ID:decorator1991,项目名称:proselint,代码行数:8,代码来源:symbols.py


示例11: check_ly

def check_ly(text):
    """Check the text."""
    err = "garner.phrasal_adjectives.ly"
    msg = u"""No hyphen is necessary in phrasal adjectives with an adverb
              ending in -ly."""

    return existence_check(text, ["ly-"], err, msg,
                           require_padding=False, offset=-1)
开发者ID:TimBuckley,项目名称:proselint,代码行数:8,代码来源:phrasal_adjectives.py


示例12: check_without_your_collusion

def check_without_your_collusion(text):
    """Check the textself."""
    err = "garner.illogic.collusion"
    msg = "It's impossible to defraud yourself. Try 'aquiescence'."

    regex = "without your collusion"

    return existence_check(text, [regex], err, msg, require_padding=False, offset=-1)
开发者ID:Uran198,项目名称:proselint,代码行数:8,代码来源:illogic.py


示例13: check_coin_a_phrase_from

def check_coin_a_phrase_from(text):
    """Check the text."""
    err = "garner.illogic.coin"
    msg = "You can't coin an existing phrase. Did you mean 'borrow'?"

    regex = "to coin a phrase from"

    return existence_check(text, [regex], err, msg, offset=1)
开发者ID:Uran198,项目名称:proselint,代码行数:8,代码来源:illogic.py


示例14: check_ellipsis

def check_ellipsis(text):
    """Use an ellipsis instead of three dots."""
    err = "palahniuk.suddenly"
    msg = u"Suddenly is nondescript, slows the action, and warns your reader."
    regex = "Suddenly,"

    return existence_check(text, [regex], err, msg, max_errors=3,
                           require_padding=False, offset=-1, ignore_case=False)
开发者ID:ComSecNinja,项目名称:proselint,代码行数:8,代码来源:suddenly.py


示例15: check

def check(text):
    """Suggest the preferred forms."""
    err = "pinker.hedging"
    msg = "Hedging. Just say it."

    narcisissm = ["I would argue that", ", so to speak", "to a certain degree"]

    return existence_check(text, narcisissm, err, msg)
开发者ID:Uran198,项目名称:proselint,代码行数:8,代码来源:hedging.py


示例16: check_very_damn

def check_very_damn(text):
    """Use the registered trademark symbol instead of (R)."""
    err = "twain.damn"
    msg = ("Substitute 'damn' every time you're "
           "inclined to write 'very;' your editor will delete it "
           "and the writing will be just as it should be.")
    regex = "very"

    return existence_check(text, [regex], err, msg, max_errors=1)
开发者ID:ComSecNinja,项目名称:proselint,代码行数:9,代码来源:damn.py


示例17: check_repeated_exclamations

def check_repeated_exclamations(text):
    """Check the text."""
    err = "leonard.hell"
    msg = u"Never use the words 'all hell broke loose'."

    regex = r"all hell broke loose"

    return existence_check(
        text, [regex], err, msg, max_errors=1)
开发者ID:ComSecNinja,项目名称:proselint,代码行数:9,代码来源:hell.py


示例18: check_et_al

def check_et_al(text):
    """Check the text."""
    err = "garner.punctuation"
    msg = u"Misplaced punctuation. It's 'et al.'"

    list = [
        "et. al",
        "et. al."
    ]
    return existence_check(text, list, err, msg, join=True)
开发者ID:ComSecNinja,项目名称:proselint,代码行数:10,代码来源:punctuation.py


示例19: check_repeated_exclamations

def check_repeated_exclamations(text):
    """Check the text."""
    err = "skekely.nword"
    msg = u"Take responsibility for the shitty words you want to say."

    list = [
        "the n-word",
    ]

    return existence_check(text, list, err, msg)
开发者ID:ComSecNinja,项目名称:proselint,代码行数:10,代码来源:nword.py


示例20: check

def check(text):
    """Suggest the preferred forms."""
    err = "pinker.apologizing"
    msg = "Excessive apologizing."

    narcisissm = [
        "More research is needed",
    ]

    return existence_check(text, narcisissm, err, msg)
开发者ID:ComSecNinja,项目名称:proselint,代码行数:10,代码来源:apologizing.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python tools.exit函数代码示例发布时间:2022-05-27
下一篇:
Python tools.ensure_dev_path函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap