Limnoria/plugins/String
2021-09-21 21:41:25 +02:00
..
locales Fix msgfmt warnings. 2020-03-26 22:10:28 +01:00
__init__.py all: Add generic 'The Limnoria Contributors' to copyright notices. 2021-08-01 21:54:49 +02:00
config.py all: Add generic 'The Limnoria Contributors' to copyright notices. 2021-08-01 21:54:49 +02:00
messages.pot Squashed commit of the following: 2014-12-20 14:37:27 +01:00
plugin.py all: Add generic 'The Limnoria Contributors' to copyright notices. 2021-08-01 21:54:49 +02:00
README.rst all plugins: regenerate READMEs 2021-04-22 00:29:15 +02:00
test.py String: Fix TypeError. 2021-09-21 21:41:25 +02:00

Documentation for the String plugin for Supybot

Purpose

Provides various commands to manipulate characters and strings.

Usage

Provides useful commands for manipulating characters and strings.

Commands

chr <number>

Returns the unicode character associated with codepoint <number>

decode <encoding> <text>

Returns an un-encoded form of the given text; the valid encodings are available in the documentation of the Python codecs module: <http://docs.python.org/library/codecs.html#standard-encodings>.

encode <encoding> <text>

Returns an encoded form of the given text; the valid encodings are available in the documentation of the Python codecs module: <http://docs.python.org/library/codecs.html#standard-encodings>.

len <text>

Returns the length of <text>.

levenshtein <string1> <string2>

Returns the levenshtein distance (also known as the "edit distance" between <string1> and <string2>)

md5 <text>

Returns the md5 hash of a given string.

ord <letter>

Returns the unicode codepoint of <letter>.

re <regexp> <text>

If <regexp> is of the form m/regexp/flags, returns the portion of <text> that matches the regexp. If <regexp> is of the form s/regexp/replacement/flags, returns the result of applying such a regexp to <text>.

sha <text>

Returns the SHA1 hash of a given string.

soundex <string> [<length>]

Returns the Soundex hash to a given length. The length defaults to 4, since that's the standard length for a soundex hash. For unlimited length, use 0. Maximum length 1024.

unicodename <character>

Returns the name of the given unicode <character>.

unicodesearch <name>

Searches for a unicode character from its <name>.

xor <password> <text>

Returns <text> XOR-encrypted with <password>.

Configuration

supybot.plugins.String.levenshtein

This is a group of:

supybot.plugins.String.levenshtein.max

This config variable defaults to "256", is not network-specific, and is not channel-specific.

Determines the maximum size of a string given to the levenshtein command. The levenshtein command uses an O(m*n) algorithm, which means that with strings of length 256, it can take 1.5 seconds to finish; with strings of length 384, though, it can take 4 seconds to finish, and with strings of much larger lengths, it takes more and more time. Using nested commands, strings can get quite large, hence this variable, to limit the size of arguments passed to the levenshtein command.

supybot.plugins.String.public

This config variable defaults to "True", is not network-specific, and is not channel-specific.

Determines whether this plugin is publicly visible.

supybot.plugins.String.re

This is a group of:

supybot.plugins.String.re.timeout

This config variable defaults to "0.1", is not network-specific, and is not channel-specific.

Determines the maximum time, in seconds, that a regular expression is given to execute before being terminated. Since there is a possibility that user input for the re command can cause it to eat up large amounts of ram or cpu time, it's a good idea to keep this low. Most normal regexps should not take very long at all.