#pragma once
#include "rust/cxx.h"
#include <memory>
#include "cld3/nnet_language_identifier.h"
#include <stdbool.h>
#include <stdlib.h>
#include <string>
#include <string.h>
#include <stdexcept>
namespace rust::behavior {
template <typename Try, typename Fail>
static void trycatch(Try &&func, Fail &&fail) noexcept try {
func();
} catch (const std::exception &e) {
fail(e.what());
}
}
using namespace chrome_lang_id;
struct SharedResult;
std::unique_ptr<NNetLanguageIdentifier> new_language_identifier_default();
std::unique_ptr<NNetLanguageIdentifier> new_language_identifier(int minNumBytes, int maxNumBytes);
SharedResult find_language(NNetLanguageIdentifier &li, rust::Str text);
rust::Vec<SharedResult> find_topn_most_freq_langs(NNetLanguageIdentifier &li, rust::Str text, int num_langs);