"""
Gherbal — FastText-based multilingual language identification.

Usage:
    from gherbal import Gherbal, GherbalConfig

    # Load from local directory
    model = Gherbal.from_pretrained("./my_model")

    # Load from HuggingFace Hub
    model = Gherbal.from_pretrained("omarkamali/gherbal")

    # Predict
    model.predict("Bonjour le monde")
    # => [('fra_Latn', 0.98), ...]

    # Train a new model
    model = Gherbal.train(train_df, save_path="./output")
"""

from importlib.metadata import version, PackageNotFoundError

try:
    __version__ = version("gherbal")
except PackageNotFoundError:
    __version__ = "1.0.1"

from .config import GherbalConfig
from .model import Gherbal
from .preprocessing import (
    preprocess_text,
    clean_script,
    unscript,
    create_clean_script_function,
)
from .training import train_fasttext, DEFAULT_DICT_PROPS, DEFAULT_TRAIN_OPTS
from .evaluation import evaluate, report, get_confused_pairs, plot_stats

__all__ = [
    # Core
    "Gherbal",
    "GherbalConfig",
    # Preprocessing
    "preprocess_text",
    "clean_script",
    "unscript",
    "create_clean_script_function",
    # Training
    "train_fasttext",
    "DEFAULT_DICT_PROPS",
    "DEFAULT_TRAIN_OPTS",
    # Evaluation
    "evaluate",
    "report",
    "get_confused_pairs",
    "plot_stats",
]
