Move some constants into the constants file
This commit is contained in:
parent
7541b88101
commit
ba2e2e5ee9
@ -1,14 +1,8 @@
|
|||||||
import re
|
|
||||||
|
|
||||||
from hyphen import Hyphenator
|
from hyphen import Hyphenator
|
||||||
|
|
||||||
from chordpro.constants import KNOWN_DIRECTIVES, KNOWN_VERSE_TYPES
|
from chordpro.constants import DIRECTIVE, CHORD_WORD, CHORUS_MARKER, KNOWN_DIRECTIVES, \
|
||||||
|
START_OF, END_OF
|
||||||
|
|
||||||
DIRECTIVE = re.compile(r'\{(.*?): *(.*?)\}')
|
|
||||||
START_OF = re.compile(r'\{start_of_(' + '|'.join(KNOWN_VERSE_TYPES) + r')(: *(.*?))?\}')
|
|
||||||
END_OF = re.compile(r'\{end_of_(' + '|'.join(KNOWN_VERSE_TYPES) + r')\}')
|
|
||||||
CHORUS_MARKER = re.compile(r'\{chorus(: *(.*?))?\}')
|
|
||||||
CHORD_WORD = re.compile(r'(.*?)\[(.*?)\]')
|
|
||||||
HYPHEN_CACHE = {}
|
HYPHEN_CACHE = {}
|
||||||
SYLLABLE_EXCEPTIONS = {
|
SYLLABLE_EXCEPTIONS = {
|
||||||
'outer': ['out', 'er']
|
'outer': ['out', 'er']
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import re
|
||||||
|
|
||||||
KNOWN_DIRECTIVES = [
|
KNOWN_DIRECTIVES = [
|
||||||
('title', 't'),
|
('title', 't'),
|
||||||
('subtitle', 'st'),
|
('subtitle', 'st'),
|
||||||
@ -27,3 +29,8 @@ GERMAN_NOTES = '[CDEFGAH]'
|
|||||||
NEOLATIN_NOTES = '(Do|Re|Mi|Fa|Sol|La|Si)'
|
NEOLATIN_NOTES = '(Do|Re|Mi|Fa|Sol|La|Si)'
|
||||||
CHORD_SUFFIXES = '(b|bb)?(#)?(m|maj7|maj|min7|min|sus)?(1|2|3|4|5|6|7|8|9)?'
|
CHORD_SUFFIXES = '(b|bb)?(#)?(m|maj7|maj|min7|min|sus)?(1|2|3|4|5|6|7|8|9)?'
|
||||||
SLIM_CHARS = 'fiíIÍjlĺľrtť.,;/ ()|"\'!:\\'
|
SLIM_CHARS = 'fiíIÍjlĺľrtť.,;/ ()|"\'!:\\'
|
||||||
|
DIRECTIVE = re.compile(r'\{(.*?): *(.*?)\}')
|
||||||
|
START_OF = re.compile(r'\{start_of_(' + '|'.join(KNOWN_VERSE_TYPES) + r')(: *(.*?))?\}')
|
||||||
|
END_OF = re.compile(r'\{end_of_(' + '|'.join(KNOWN_VERSE_TYPES) + r')\}')
|
||||||
|
CHORUS_MARKER = re.compile(r'\{chorus(: *(.*?))?\}')
|
||||||
|
CHORD_WORD = re.compile(r'(.*?)\[(.*?)\]')
|
||||||
|
Loading…
Reference in New Issue
Block a user