Beispiel #1
0
class CustomVSCode(MergeRule):
    pronunciation = "custom sublime commands"
    mapping = {
        # my custom overrides
        "save file as":
        R(Key("cs-s"), rdescript="Sublime: Save As"),
        "grab it":
        R(Key("c-d"), rdescript="Sublime: Ctrl + d"),
        "skip it":
        R(Key("c-k,c-d"), rdescript="Sublime: Ctrl + d, k"),
        "uppercase":
        R(Key("csa-u"), rdescript="Sublime: uppercase"),
        "lowercase":
        R(Key("csa-l"), rdescript="Sublime: uppercase"),
        "cue jeep":
        R(Key("a-up"), rdescript="Sublime: uppercase"),
        "cue doom":
        R(Key("a-down"), rdescript="Sublime: uppercase"),
        "execute":
        R(Key("s-enter"), rdescript="Sublime: Ctrl + b"),
        "[go to] group [<n2>]":
        R(Key("c-%(n2)s"), rdescript="Sublime: Go to Group #"),
        "spring <n>":
        R(Key("c-g") + Pause("10") + Text("%(n)s") + Key("enter"),
          rdescript="Sublime: Go to Line #"),
        "crew [<text>]":
        R(Key("c-i") + Pause("10") + Text("%(text)s") + Pause("10") +
          Key("enter") + Key("escape"),
          rdescript="Sublime: Get Next"),
        "trail [<text>]":
        R(Key("c-u") + Pause("10") + Text("%(text)s") + Pause("10") +
          Key("enter") + Key("escape"),
          rdescript="Sublime: Get Next"),
        "expand|fill quotes":
        R(Key("cs-space"), rdescript="Atom: Expand Selection to Quotes"),
        # SymbolSpecs.FUNCTION:                       R(Text("fu\\") + Key("tab"), rdescript="CustomSublime: Function"),
        # SymbolSpecs.IF:                             R(Text("if\\") + Key("tab"), rdescript="ColdFusion: If"),
        # my custom overrides
        "double quotes":
        R(Key("dquote"), rdescript="Quotation Marks"),
        "Quach it":
        R(Key("apostrophe"), rdescript="Thin Quotation Marks"),
        "(cellaring | sell rang) <n> <n3>":
        R(
            Key("c-g") + Pause("5") + Text("%(n)s") + Key("enter") +
            Pause("5") + Key("c-k") + Key("c-space") + Pause("5") +
            Key("c-g") + Pause("10") + Text("%(n3)s") + Key("enter") +
            Key("end") + Key("c-k") + Key("c-a")),
    }

    extras = [
        Dictation("text"),
        Dictation("mim"),
        IntegerRefST("n", 1, 1000),
        IntegerRefST("n2", 1, 9),
        IntegerRefST("n3", 1, 999),
    ]
    defaults = {"n": 1, "mim": "", "text": ""}
Beispiel #2
0
    def test_non_ascii_key(self):
        """ Test handling of non-ASCII characters in ActionSeries actions.
        """

        action = Key(u"é") + Text(u"á")
        self.assertEqual(str(action), "[%r]+%r" % (u"é", u"á"))

        action = Key(u"é") | Text(u"á")
        self.assertEqual(str(action), "[%r]|%r" % (u"é", u"á"))
Beispiel #3
0
class PutStringCommandsRule(MappingRule):
    mapping = {
        "put e-mail":
        Text("*****@*****.**"),
        "put first":
        Text("Petko"),
        "put last":
        Text("Kostadinov"),
        "put username":
        Text("petkoxray"),
        "put [whole] name":
        Text("Petko Kostadinov"),
        "put address":
        Text(""),
        "put jimhub":
        Text("https://github.com/petkoxray"),
        "put lorem ipsum":
        Text(
            "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
        ),
        "put city":
        Text("Plovdiv"),
        #"put state": Text("CA"),
        #"put zip": Text("94901"),
        #"put phone": Text("415 297 6170"),
        #"put Google phone": Text("415 548 1460"),
        #"put user": Text("haughki"),
        # "put Dragon info": Text("NatLink 4.1mike\nDNS 13\nPython 2.7\nWindows 7"),
    }
Beispiel #4
0
class CustomVSCode(MergeRule):
    pronunciation = "custom visual studio code"
    mapping = {
        "save file as":
        R(Key("cs-s"), rdescript="VS Code: Save As"),
        "uppercase":
        R(Key("csa-u"), rdescript="VS Code: uppercase"),
        "lowercase":
        R(Key("csa-l"), rdescript="VS Code: lowercase"),
        "execute":
        R(Key("s-enter"), rdescript="VS Code: Ctrl + b"),
        "[go to] group [<n2>]":
        R(Key("c-%(n2)s"), rdescript="VS Code: Go to Group #"),
        "spring <n>":
        R(Key("c-g") + Pause("10") + Text("%(n)s") + Key("enter"),
          rdescript="VS Code: Go to Line #"),
        "crew [<text>]":
        R(Key("c-f") + Pause("10") + Text("%(text)s") + Pause("10") +
          Key("escape"),
          rdescript="VS Code: Get Next"),
        "trail [<text>]":
        R(Key("c-f") + Pause("10") + Text("%(text)s") + Pause("10") +
          Key("s-enter") + Key("escape"),
          rdescript="VS Code: Get Next"),
        "expand|fill quotes":
        R(Key("cs-space"), rdescript="VS Code: Expand Selection to Quotes"),
        "(cellaring | sell rang) <n> <n3>":
        R(
            Key("c-g") + Pause("5") + Text("%(n)s") + Key("enter") +
            Pause("5") + Key("c-k") + Key("c-b") + Pause("5") + Key("c-g") +
            Pause("10") + Text("%(n3)s") + Key("enter") + Key("end") +
            Key("c-k") + Key("c-k")),

        # The following commands of been enabled via words.txt
        # If Caster gets rid of transformers, reenable these words
        # "grab it":
        #     R(Key("c-d"), rdescript="VS Code: Ctrl + d"),
        # "skip it":
        #     R(Key("c-k,c-d"), rdescript="VS Code: Ctrl + d, k"),
        # "cue jeep":
        #     R(Key("a-up"), rdescript="VS Code: uppercase"),
        # "cue doom":
        #     R(Key("a-down"), rdescript="VS Code: uppercase"),
    }

    extras = [
        Dictation("text"),
        Dictation("mim"),
        ShortIntegerRef("n", 1, 1000),
        ShortIntegerRef("n2", 1, 9),
        ShortIntegerRef("n3", 1, 999),
    ]
    defaults = {"n": 1, "mim": "", "text": ""}
Beispiel #5
0
    def __init__(self, num_choice_500s, num_specs):

        mapping = {}
        extras = []
        defaults = {}

        w500 = get_500_words()
        spec_base = ""
        text_base = ""

        for k in range(0, num_choice_500s):
            extra_name = "giant_" + str(k)
            spec_base += " <" + extra_name + ">"
            text_base += " %(" + extra_name + ")s"
            extras.append(get_giant_choice(extra_name))

        for i in range(0, num_specs):
            word = w500[i]
            mapping[word + spec_base] = R(Text(word + text_base), show=False)

        MergeRule.__init__(self,
                           name="complexity test",
                           mapping=mapping,
                           extras=extras,
                           defaults=defaults)
Beispiel #6
0
class SSMSRule(MergeRule):
    pronunciation = "custom sequel server management studio"

    mapping = {
        # There doesn't seem to be a hotkey for sequential tab navigation in SSMS, but something is better than nothing...
        "next tab [<n>]":
            R(Key("c-tab"), rdescript="SSMS: Next Tab")*Repeat(extra="n"),
        "prior tab [<n>]":
            R(Key("cs-tab"), rdescript="SSMS: Previous Tab")*Repeat(extra="n"),
        "close tab [<n>]":
            R(Key("c-f4/20"), rdescript="SSMS: Close Tab")*Repeat(extra="n"),
        "go to line":
            R(Key("c-g"), rdescript="SSMS: Go To Line"),
        "[go to] line <n>":
            R(Key("c-g") + Pause("10") + Text("%(n)s") + Key("enter"),
              rdescript="SSMS: Go to Line #"),
        "comment line":
            R(Key("c-k, c-c"), rdescript="SSMS: Comment Selection"),
        "comment block":
            R(Key("c-k, c-c"), rdescript="SSMS: Comment Block"),
        "(un | on) comment line":
            R(Key("c-k/50, c-u"), rdescript="SSMS: Uncomment Selection"),
        "(un | on) comment block":
            R(Key("c-k/50, c-u"), rdescript="SSMS: Uncomment Block"),
        "[toggle] full screen":
            R(Key("sa-enter"), rdescript="SSMS: Fullscreen"),
        "(set | toggle) bookmark":
            R(Key("c-k, c-k"), rdescript="SSMS: Toggle Bookmark"),
        "next bookmark":
            R(Key("c-k, c-n"), rdescript="SSMS: Next Bookmark"),
        "prior bookmark":
            R(Key("c-k, c-p"), rdescript="SSMS: Previous Bookmark"),
        "[toggle] breakpoint":
            R(Key("f9"), rdescript="SSMS: Breakpoint"),
        "step over [<n>]":
            R(Key("f10/50")*Repeat(extra="n"), rdescript="SSMS: Step Over"),
        "step into":
            R(Key("f11"), rdescript="SSMS: Step Into"),
        "step out [of]":
            R(Key("s-f11"), rdescript="SSMS: Step Out"),
        "resume":
            R(Key("f5"), rdescript="SSMS: Resume"),
        "execute":
            R(Key("f5"), rdescript="SQL: Count"),
        "switch focus [<n>]":
            R(Key("f6"), rdescript="SQL: Switch Focus")*Repeat(extra="n"),
        "back focus [<n>]":
            R(Key("s-f6"), rdescript="SQL: Back Focus")*Repeat(extra="n"),
    }
    extras = [
        Dictation("text"),
        Dictation("mim"),
        IntegerRefST("n", 1, 1000),
    ]
    defaults = {"n": 1, "mim": ""}
Beispiel #7
0
 def refresh(self, *args):
     aliases = utilities.load_json_file(settings.SETTINGS["paths"]["ALIAS_PATH"])
     if not ChainAlias.json_path in aliases:
         aliases[ChainAlias.json_path] = {}
     if len(args) > 0 and args[0] != "":
         aliases[ChainAlias.json_path][args[0]] = args[1]
         utilities.save_json_file(aliases, settings.SETTINGS["paths"]["ALIAS_PATH"])
     mapping = {}
     for spec in aliases[ChainAlias.json_path]:
         mapping[spec] = R(
             Text(str(aliases[ChainAlias.json_path][spec])),
             rdescript="Chain Alias: " + spec)
     mapping["chain alias"] = R(
         Function(self.chain_alias), rdescript="Create Chainable Alias")
     mapping["delete chain aliases"] = R(
         Function(lambda: delete_all(self, ChainAlias.json_path)),
         rdescript="Delete Aliases")
     self.reset(mapping)
Beispiel #8
0
 def refresh(self, *args):
     '''args: spec, text'''
     aliases = utilities.load_json_file(settings.SETTINGS["paths"]["ALIAS_PATH"])
     if not Alias.json_path in aliases:
         aliases[Alias.json_path] = {}
     if len(args) > 0:
         aliases[Alias.json_path][args[0]] = args[1]
         utilities.save_json_file(aliases, settings.SETTINGS["paths"]["ALIAS_PATH"])
     mapping = {}
     for spec in aliases[Alias.json_path]:
         mapping[spec] = R(
             Text(str(aliases[Alias.json_path][spec])),
             rdescript="Alias: " + spec)
     mapping["alias <s>"] = R(
         Function(lambda s: self.alias(s)), rdescript="Create Alias")
     mapping["delete aliases"] = R(
         Function(lambda: delete_all(self, Alias.json_path)),
         rdescript="Delete Aliases")
     self.reset(mapping)
class YarnCommands(MergeRule):
    pronunciation = "yarn commands"
    mapping = {
        "yarn":
        R(Text("yarn"), rdescript="Yarn: yarn"),
        "yarn global add":
        R(Text("yarn global add"), rdescript="Yarn: yarn global add"),
        "build my client":
        R(Text("yarn build client --env api-ashley"),
          rdescript="Yarn: yarn global add"),
        "build my API":
        R(Text("yarn build api --env api-ashley"),
          rdescript="Yarn: yarn global add"),
        "yarn client":
        R(Text("yarn client"), rdescript="Yarn: yarn global add"),
        "API ashley":
        R(Text("api-ashley"), rdescript="Yarn: yarn global add"),
    }
    extras = [
        IntegerRefST("n", 1, 10),
    ]
    defaults = {"n": 1}
Beispiel #10
0
def notepad_message(message, sec100=100):
    action = Text(message) + Pause(str(sec100))
    action.execute()
def update_python(rule):
    if "shells" in rule.mapping_actual().keys():
        rule.mapping_actual()["shells"] = R(Text("not allowed to use 'else'"),
                                            rdescript="Troll Replacement")
class CustomPunctuation(MergeRule):
    pronunciation = "custom punctuation"
    mapping = {

        # my custom overrides
        "double quotes":
        R(Key("dquote"), rdescript="Quotation Marks"),
        "Quach it":
        R(Key("apostrophe"), rdescript="Thin Quotation Marks"),
        "equals | equal to":
        R(Text("="), rdescript="Equals"),
        "equeft":
        R(Text(" = "), rdescript="Equals"),
        "Schrock it | shrocket":
        R(Text(" => "), rdescript="Equals"),
        "not equals | not equal to":
        R(Text(" != "), rdescript="Not Equal To"),
        "is equal to":
        R(Text(" == "), rdescript="Not Equal To"),
        "[is] greater than":
        R(Text(" > "), rdescript="> Comparison"),
        "[is] less than":
        R(Text(" < "), rdescript="< Comparison"),
        "[is] greater [than] [or] equal [to]":
        R(Text(" >= "), rdescript=">= Comparison"),
        "[is] less [than] [or] equal [to]":
        R(Text(" <= "), rdescript="<= Comparison"),
        "deplush":
        R(Text(" + "), rdescript="Plus with padding"),
        "plus":
        R(Text("+"), rdescript="Plus"),
        "pluqual | Luke while":
        R(Text(" += "), rdescript="Plus Equals"),
        "deminus":
        R(Text(" - "), rdescript="Minus with padding"),
        "minus":
        R(Text("-"), rdescript="Minus"),
        "minqual | min call":
        R(Text(" -= "), rdescript="Minus Equals"),
        "min twice | mintwice":
        R(Text("--"), rdescript="Minus Twice"),

        # this is same as the default punctuation
        "sinker":
        R(Key("semicolon"), rdescript="Semicolon"),
        "prekris":
        R(Key("lparen"), rdescript="Parentheses"),
        "prekorp":
        R(Key("lparen"), rdescript="Parentheses"),
        "prekos":
        R(Key("rparen"), rdescript="Parentheses"),
        "brax":
        R(Key("lbracket"), rdescript="Square Brackets"),
        "brackorp":
        R(Key("lbracket"), rdescript="Left Square Bracket"),
        "brackos":
        R(Key("rbracket"), rdescript="Right Square Bracket"),
        "curly":
        R(Key("lbrace"), rdescript="Curly Braces"),
        "kirksorp":
        R(Key("lbrace"), rdescript="Left Curly Brace"),
        "kirkos":
        R(Key("rbrace"), rdescript="Right Curly Brace"),
        "angle":
        R(Key("langle"), rdescript="Left Angle Bracket"),
        "wrangle":
        R(Key("rangle"), rdescript="Right Angle Bracket"),
        "(pipe | pipes) (sim | symbol)":
        R(Text("|"), rdescript="Pipe Symbol"),
        "pipes and":
        R(Text("|"), rdescript="Pipe Symbol"),
        'skoosh [<npunc>]':
        R(Key("space"), rdescript="Space") * Repeat(extra="npunc"),
        "clamor":
        R(Text("!"), rdescript="Exclamation Mark"),
        "deckle":
        R(Text(":"), rdescript="Colon"),
        "starling":
        R(Key("asterisk"), rdescript="Asterisk"),
        "questo":
        R(Text("?"), rdescript="Question Mark"),
        "comma":
        R(Text(","), rdescript="Comma"),
        "carrot":
        R(Text("^"), rdescript="Carat"),
        "(period | dot)":
        R(Text("."), rdescript="Dot"),
        "at sign":
        R(Text("@"), rdescript="At Sign"),
        "hash tag | pound sign | pounder":
        R(Text("#"), rdescript="Hash Tag"),
        "apostrophe":
        R(Text("'"), rdescript="Apostrophe"),
        "tinker":
        R(Text("`"), rdescript='back tick'),
        "crunder":
        R(Text("_"), rdescript="Underscore"),
        "shawls":
        R(Text("\\"), rdescript="Back Slash"),
        "slash":
        R(Text("/"), rdescript="Forward Slash"),
        "Dolly":
        R(Text("$"), rdescript="Dollar Sign"),
        "Percy":
        R(Key("percent"), rdescript="Percent Sign"),
        'tarp [<npunc>]':
        R(Key("tab"), rdescript="Tab") * Repeat(extra="npunc"),
        'tarsh [<npunc>]':
        R(Key("s-tab"), rdescript="Tab") * Repeat(extra="npunc"),
        'shaber [<npunc>]':
        R(Key("c-rbracket"), rdescript="Tab") * Repeat(extra="npunc"),
        'shable [<npunc>]':
        R(Key("c-lbracket"), rdescript="Tab") * Repeat(extra="npunc"),
        "swipe":
        R(Text(", "), rdescript="Comma + Space"),
    }

    extras = [
        IntegerRefST("npunc", 0, 10),
    ]
    defaults = {
        "npunc": 1,
    }
Beispiel #13
0
class SQL(MergeRule):
    pronunciation = "sequel"

    mapping = {
        "select":
        R(Text(" SELECT "), rdescript="SQL: Select"),
        "select (all | every)":
        R(Text(" SELECT * "), rdescript="SQL: Select All"),
        "from":
        R(Text(" FROM "), rdescript="SQL: From"),
        "where":
        R(Text(" WHERE "), rdescript="SQL: Where"),
        "between":
        R(Text(" BETWEEN "), rdescript="SQL: Between"),
        "lodge and ":
        R(Text(" AND "), rdescript="SQL: And"),
        "lodge or":
        R(Text(" OR "), rdescript="SQL: Or"),
        "it are in":
        R(Text(" IN "), rdescript="SQL: In"),
        "equals | equal to":
        R(Text(" = "), rdescript="SQL: Equals"),
        "not equals | not equal to":
        R(Text(" <> "), rdescript="SQL: Not Equal To"),
        "group by":
        R(Text(" GROUP BY "), rdescript="SQL: Group By"),
        "order by":
        R(Text(" ORDER BY "), rdescript="Order By"),
        "ascending":
        R(Text(" ASC "), rdescript="SQL: Ascending"),
        "descending":
        R(Text(" DESC "), rdescript="SQL: Descending"),
        "left join":
        R(Text(" LEFT JOIN "), rdescript="SQL: Left Join"),
        "inner join":
        R(Text(" INNER JOIN "), rdescript="SQL: Inner Join"),
        "right join":
        R(Text(" RIGHT JOIN "), rdescript="SQL: Right Join"),
        "full join":
        R(Text(" FULL JOIN "), rdescript="SQL: Full Join"),
        "join":
        R(Text(" JOIN "), rdescript="SQL: Join"),
        "on columns":
        R(Text(" ON "), rdescript="SQL: On"),
        "using":
        R(Text(" USING () ") + Key("left/5:2"), rdescript="SQL: Using"),
        "insert into":
        R(Text(" INSERT INTO "), rdescript="SQL: Insert"),
        "update":
        R(Text(" UPDATE TOKEN SET "), rdescript="SQL: Update"),
        "delete":
        R(Text(" DELETE "), rdescript="SQL: Delete"),
        "like":
        R(Text(" LIKE '%%'") + Key("left/5:2"), rdescript="SQL: Like"),
        "union":
        R(Text(" UNION "), rdescript="SQL: Union"),
        "alias as":
        R(Text(" AS "), rdescript="SQL: Alias As"),
        "is null":
        R(Text(" IS NULL "), rdescript="SQL: Is Null"),
        "is not null":
        R(Text(" IS NOT NULL "), rdescript="SQL: Is Not Null"),
        "fun max":
        R(Text(" MAX() ") + Key("left/5:2"), rdescript="SQL: Max"),
        "fun min":
        R(Text(" MIN() ") + Key("left/5:2"), rdescript="SQL: Min"),
        "fun count":
        R(Text(" COUNT() ") + Key("left/5:2"), rdescript="SQL: Count"),
        "fun average":
        R(Text(" AVG() ") + Key("left/5:2"), rdescript="SQL: Average"),
        "over partition by":
        R(Text(" OVER (PARTITION BY ) ") + Key("left/5:2"),
          rdescript="SQL: Over Partition By"),
    }

    extras = []
    defaults = {}
Beispiel #14
0
def prior_text_format(textnv):
    global _CAPITALIZATION, _SPACING
    Text(get_formatted_text(_CAPITALIZATION, _SPACING, str(textnv))).execute()
Beispiel #15
0
def master_format_text(capitalization, spacing, textnv):
    capitalization, spacing = normalize_text_format(capitalization, spacing)
    Text(get_formatted_text(capitalization, spacing, str(textnv))).execute()
Beispiel #16
0
    def test_non_ascii_text(self):
        """ Test handling of non-ASCII characters in Text action. """

        action = Text(u"touché")
        self.assertEqual(str(action), "%r" % (u"touché", ))
Beispiel #17
0
 def replace_if_action(mp):
     if mp.rule1 is not None:
         mp.rule1.mapping_actual()[SymbolSpecs.IF] = Text("test")
     mp.rule2.mapping_actual()[SymbolSpecs.IF] = Text("test")
Beispiel #18
0
class SQL(MergeRule):
    pronunciation = "sequel"

    mapping = {
        "select":
        R(Text(" select "), rdescript="SQL: Select"),
        "select all":
        R(Text(" select * "), rdescript="SQL: Select All"),
        "from":
        R(Text(" from "), rdescript="SQL: From"),
        "where":
        R(Text(" where "), rdescript="SQL: Where"),
        "lodge and ":
        R(Text(" and "), rdescript="SQL: And"),
        "lodge or":
        R(Text(" or "), rdescript="SQL: Or"),
        "it are in":
        R(Text(" in "), rdescript="SQL: In"),
        "equals | equal to":
        R(Text(" = "), rdescript="SQL: Equals"),
        "not equals | not equal to":
        R(Text(" <> "), rdescript="SQL: Not Equal To"),
        "group by":
        R(Text(" group by "), rdescript="SQL: Group By"),
        "order by":
        R(Text(" order by "), rdescript="Order By"),
        "ascending":
        R(Text(" asc "), rdescript="SQL: Ascending"),
        "descending":
        R(Text(" desc "), rdescript="SQL: Descending"),
        "left join":
        R(Text(" left join "), rdescript="SQL: Left Join"),
        "join":
        R(Text(" join "), rdescript="SQL: Join"),
        "on columns":
        R(Text(" on "), rdescript="SQL: On"),
        "using":
        R(Text(" using () ") + Key("left/5:2"), rdescript="SQL: Using"),
        "insert into":
        R(Text(" insert into "), rdescript="SQL: Insert"),
        "update":
        R(Text(" update TOKEN set "), rdescript="SQL: Update"),
        "delete":
        R(Text(" delete "), rdescript="SQL: Delete"),
        "like":
        R(Text(" like '%%'") + Key("left/5:2"), rdescript="SQL: Like"),
        "union":
        R(Text(" union "), rdescript="SQL: Union"),
        "alias as":
        R(Text(" as "), rdescript="SQL: Alias As"),
        "is null":
        R(Text(" is null "), rdescript="SQL: Is Null"),
        "is not null":
        R(Text(" is not null "), rdescript="SQL: Is Not Null"),
        "fun max":
        R(Text(" max() ") + Key("left/5:2"), rdescript="SQL: Max"),
        "fun count":
        R(Text(" count() ") + Key("left/5:2"), rdescript="SQL: Count"),
        "over partition by":
        R(Text(" over (partition by ) ") + Key("left/5:2"),
          rdescript="SQL: Over Partition By"),
    }

    extras = []
    defaults = {}
def add_is_to_python(rule):
    if rule.get_pronunciation() == "Python":
        rule.mapping_actual()["identity is"] = R(Text(" is "),
                                                 rdescript="Python: Is")
Beispiel #20
0
class Punctuation(MergeRule):
    pronunciation = CCRMerger.CORE[3]

    mapping = {
        "semper":
        R(Key("semicolon"), rdescript="Semicolon"),
        "quotes":
        R(Key("dquote,dquote,left"), rdescript="Quotation Marks"),
        "thin quotes":
        R(Key("apostrophe,apostrophe,left"), rdescript="Thin Quotation Marks"),
        "[is] greater than":
        R(Key("rangle"), rdescript="> Comparison"),
        "[is] less than":
        R(Key("langle"), rdescript="< Comparison"),
        "[is] greater [than] [or] equal [to]":
        R(Key("rangle, equals"), rdescript=">= Comparison"),
        "[is] less [than] [or] equal [to]":
        R(Key("langle, equals"), rdescript="<= Comparison"),
        "[is] equal to":
        R(Key("equals,equals"), rdescript="Equality"),
        "equals":
        R(Key("equals"), rdescript="Equals Sign"),
        "prekris":
        R(Key("lparen, rparen, left"), rdescript="Parentheses"),
        "brax":
        R(Key("lbracket, rbracket, left"), rdescript="Square Brackets"),
        "curly":
        R(Key("lbrace, rbrace, left"), rdescript="Curly Braces"),
        "angle":
        R(Key("langle, rangle, left"), rdescript="Angle Brackets"),
        "plus":
        R(Text("+"), rdescript="Plus Sign"),
        "minus":
        R(Text("-"), rdescript="Dash"),
        "pipe (sim | symbol)":
        R(Text("|"), rdescript="Pipe Symbol"),
        'ace [<npunc>]':
        R(Key("space"), rdescript="Space") * Repeat(extra="npunc"),
        "clamor":
        R(Text("!"), rdescript="Exclamation Mark"),
        "deckle":
        R(Text(":"), rdescript="Colon"),
        "starling":
        R(Key("asterisk"), rdescript="Asterisk"),
        "questo":
        R(Text("?"), rdescript="Question Mark"),
        "comma":
        R(Text(","), rdescript="Comma"),
        "carrot":
        R(Text("^"), rdescript="Carat"),
        "(period | dot)":
        R(Text("."), rdescript="Dot"),
        "at sign":
        R(Text("@"), rdescript="At Sign"),
        "hash tag":
        R(Text("#"), rdescript="Hash Tag"),
        "apostrophe":
        R(Text("'"), rdescript="Apostrophe"),
        "underscore":
        R(Text("_"), rdescript="Underscore"),
        "backslash":
        R(Text("\\"), rdescript="Back Slash"),
        "slash":
        R(Text("/"), rdescript="Forward Slash"),
        "Dolly":
        R(Text("$"), rdescript="Dollar Sign"),
        "modulo":
        R(Key("percent"), rdescript="Percent Sign"),
        'tabby [<npunc>]':
        R(Key("tab"), rdescript="Tab") * Repeat(extra="npunc"),
        "boom":
        R(Text(", "), rdescript="Comma + Space"),
        "ampersand":
        R(Key("ampersand"), rdescript="Ampersand"),
        "leap":
        R(Text("("), rdescript="Left Paren"),
        "reap":
        R(Text(")"), rdescript="Right Paren"),
        "lake":
        R(Text("{"), rdescript="Left Curly"),
        "rake":
        R(Text("}"), rdescript="Right Curly"),
        "lobe":
        R(Text("["), rdescript="Left Bracket"),
        "robe":
        R(Text("]"), rdescript="Right Bracket"),
        "backtick":
        R(Text("`"), rdescript="Backtick"),
    }

    extras = [
        IntegerRefST("npunc", 0, 10),
    ]
    defaults = {
        "npunc": 1,
    }
Beispiel #21
0
class PutStringCommandsRule(MappingRule):
    mapping = {
        "put e-mail": Text("*****@*****.**"),
        "put first": Text("Hawkeye"),
        "put last": Text("Parker"),
        "put [whole] name": Text("Hawkeye Parker"),
        "put address": Text("56 Elizabeth Way"),
        "put city": Text("San Rafael"),
        "put state": Text("CA"),
        "put zip": Text("94901"),
        "put phone": Text("415 297 6170"),
        "put Google phone": Text("415 548 1460"),
        "put user": Text("haughki"),
    }
Beispiel #22
0
def partial_format_text(word_limit,textnv):
    global _CAPITALIZATION, _SPACING   
    Text(get_formatted_text(_CAPITALIZATION, _SPACING, " ".join(str(textnv).split(" ")[0:word_limit]))).execute()