// Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#include <Rcpp.h>

using namespace Rcpp;

#ifdef RCPP_USE_GLOBAL_ROSTREAM
Rcpp::Rostream<true>&  Rcpp::Rcout = Rcpp::Rcpp_cout_get();
Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();
#endif

// youtokentome_train
std::string youtokentome_train(const std::string& input_path, const std::string& model_path, double coverage, int threads, int vocab_size, int pad_id, int unk_id, int bos_id, int eos_id);
RcppExport SEXP _tokenizers_bpe_youtokentome_train(SEXP input_pathSEXP, SEXP model_pathSEXP, SEXP coverageSEXP, SEXP threadsSEXP, SEXP vocab_sizeSEXP, SEXP pad_idSEXP, SEXP unk_idSEXP, SEXP bos_idSEXP, SEXP eos_idSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const std::string& >::type input_path(input_pathSEXP);
    Rcpp::traits::input_parameter< const std::string& >::type model_path(model_pathSEXP);
    Rcpp::traits::input_parameter< double >::type coverage(coverageSEXP);
    Rcpp::traits::input_parameter< int >::type threads(threadsSEXP);
    Rcpp::traits::input_parameter< int >::type vocab_size(vocab_sizeSEXP);
    Rcpp::traits::input_parameter< int >::type pad_id(pad_idSEXP);
    Rcpp::traits::input_parameter< int >::type unk_id(unk_idSEXP);
    Rcpp::traits::input_parameter< int >::type bos_id(bos_idSEXP);
    Rcpp::traits::input_parameter< int >::type eos_id(eos_idSEXP);
    rcpp_result_gen = Rcpp::wrap(youtokentome_train(input_path, model_path, coverage, threads, vocab_size, pad_id, unk_id, bos_id, eos_id));
    return rcpp_result_gen;
END_RCPP
}
// youtokentome_load_model
Rcpp::List youtokentome_load_model(const std::string& model_path, int threads);
RcppExport SEXP _tokenizers_bpe_youtokentome_load_model(SEXP model_pathSEXP, SEXP threadsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const std::string& >::type model_path(model_pathSEXP);
    Rcpp::traits::input_parameter< int >::type threads(threadsSEXP);
    rcpp_result_gen = Rcpp::wrap(youtokentome_load_model(model_path, threads));
    return rcpp_result_gen;
END_RCPP
}
// youtokentome_encode_as_ids
std::vector<std::vector<int>> youtokentome_encode_as_ids(SEXP model, const std::vector<std::string>& x, bool bos, bool eos, bool reverse);
RcppExport SEXP _tokenizers_bpe_youtokentome_encode_as_ids(SEXP modelSEXP, SEXP xSEXP, SEXP bosSEXP, SEXP eosSEXP, SEXP reverseSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type model(modelSEXP);
    Rcpp::traits::input_parameter< const std::vector<std::string>& >::type x(xSEXP);
    Rcpp::traits::input_parameter< bool >::type bos(bosSEXP);
    Rcpp::traits::input_parameter< bool >::type eos(eosSEXP);
    Rcpp::traits::input_parameter< bool >::type reverse(reverseSEXP);
    rcpp_result_gen = Rcpp::wrap(youtokentome_encode_as_ids(model, x, bos, eos, reverse));
    return rcpp_result_gen;
END_RCPP
}
// youtokentome_encode_as_subwords
std::vector<std::vector<std::string>> youtokentome_encode_as_subwords(SEXP model, const std::vector<std::string>& x, bool bos, bool eos, bool reverse);
RcppExport SEXP _tokenizers_bpe_youtokentome_encode_as_subwords(SEXP modelSEXP, SEXP xSEXP, SEXP bosSEXP, SEXP eosSEXP, SEXP reverseSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type model(modelSEXP);
    Rcpp::traits::input_parameter< const std::vector<std::string>& >::type x(xSEXP);
    Rcpp::traits::input_parameter< bool >::type bos(bosSEXP);
    Rcpp::traits::input_parameter< bool >::type eos(eosSEXP);
    Rcpp::traits::input_parameter< bool >::type reverse(reverseSEXP);
    rcpp_result_gen = Rcpp::wrap(youtokentome_encode_as_subwords(model, x, bos, eos, reverse));
    return rcpp_result_gen;
END_RCPP
}
// youtokentome_decode
std::string youtokentome_decode(SEXP model, const std::vector<int>& x);
RcppExport SEXP _tokenizers_bpe_youtokentome_decode(SEXP modelSEXP, SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type model(modelSEXP);
    Rcpp::traits::input_parameter< const std::vector<int>& >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(youtokentome_decode(model, x));
    return rcpp_result_gen;
END_RCPP
}
// youtokentome_recode_id_to_subword
std::vector<std::string> youtokentome_recode_id_to_subword(SEXP model, Rcpp::IntegerVector x);
RcppExport SEXP _tokenizers_bpe_youtokentome_recode_id_to_subword(SEXP modelSEXP, SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type model(modelSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(youtokentome_recode_id_to_subword(model, x));
    return rcpp_result_gen;
END_RCPP
}
// youtokentome_recode_subword_to_id
std::vector<int> youtokentome_recode_subword_to_id(SEXP model, Rcpp::StringVector x);
RcppExport SEXP _tokenizers_bpe_youtokentome_recode_subword_to_id(SEXP modelSEXP, SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type model(modelSEXP);
    Rcpp::traits::input_parameter< Rcpp::StringVector >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(youtokentome_recode_subword_to_id(model, x));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_tokenizers_bpe_youtokentome_train", (DL_FUNC) &_tokenizers_bpe_youtokentome_train, 9},
    {"_tokenizers_bpe_youtokentome_load_model", (DL_FUNC) &_tokenizers_bpe_youtokentome_load_model, 2},
    {"_tokenizers_bpe_youtokentome_encode_as_ids", (DL_FUNC) &_tokenizers_bpe_youtokentome_encode_as_ids, 5},
    {"_tokenizers_bpe_youtokentome_encode_as_subwords", (DL_FUNC) &_tokenizers_bpe_youtokentome_encode_as_subwords, 5},
    {"_tokenizers_bpe_youtokentome_decode", (DL_FUNC) &_tokenizers_bpe_youtokentome_decode, 2},
    {"_tokenizers_bpe_youtokentome_recode_id_to_subword", (DL_FUNC) &_tokenizers_bpe_youtokentome_recode_id_to_subword, 2},
    {"_tokenizers_bpe_youtokentome_recode_subword_to_id", (DL_FUNC) &_tokenizers_bpe_youtokentome_recode_subword_to_id, 2},
    {NULL, NULL, 0}
};

RcppExport void R_init_tokenizers_bpe(DllInfo *dll) {
    R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
    R_useDynamicSymbols(dll, FALSE);
}
