chromium/components/language_detection/core/language_detection_model.cc

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/language_detection//core/language_detection_model.h"

#include <algorithm>
#include <vector>

#include "base/containers/span.h"
#include "base/feature_list.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/histogram_macros_local.h"
#include "base/metrics/metrics_hashes.h"
#include "base/timer/elapsed_timer.h"
#include "base/trace_event/trace_event.h"
#include "components/language_detection/core/language_detection_resolver.h"
#include "components/optimization_guide/core/optimization_guide_features.h"
#include "components/translate/core/common/translate_constants.h"
#include "third_party/tflite_support/src/tensorflow_lite_support/cc/task/text/nlclassifier/nl_classifier.h"

namespace {

constexpr char kTFLiteModelVersion[] =;

// Util class for recording the result of loading the detection model. The
// result is recorded when it goes out of scope and its destructor is called.
class ScopedLanguageDetectionModelStateRecorder {};

}  // namespace

namespace language_detection {

#if !BUILDFLAG(IS_WIN)
BASE_FEATURE();
#endif

Prediction TopPrediction(const std::vector<Prediction>& predictions) {}

LanguageDetectionModel::LanguageDetectionModel()
    :{}

LanguageDetectionModel::~LanguageDetectionModel() = default;

std::vector<Prediction> LanguageDetectionModel::Predict(
    const std::u16string& contents,
    bool truncate) const {}

void LanguageDetectionModel::UpdateWithFile(base::File model_file) {}

bool LanguageDetectionModel::IsAvailable() const {}

std::string LanguageDetectionModel::GetModelVersion() const {}

}  // namespace language_detection