# -*- coding: utf-8 -*-
#
# This file is part of the livelex Python package.
#
# Copyright © 2019 by Wilbert Berendsen <info@wilbertberendsen.nl>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This module is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.


"""
The livelex Python module.

"""

import re


from .action import (
    Action,
    Subgroup,
    Match,
    Text,
    skip,
)

from .lexicon import (
    Lexicon,
    lexicon,
    default_action,
    default_target,
)

from .language import (
    Language,
)

from .lex import (
    Lexer,
)

from .regex import (
    Pattern,
    Words,
)


def version():
    from . import pkginfo
    return tuple(map(int, re.findall(r'\d+', pkginfo.version)))


