#include "components/dom_distiller/core/page_features.h"
#include <stddef.h>
#include <memory>
#include <string>
#include <string_view>
#include "base/json/json_reader.h"
#include "third_party/re2/src/re2/re2.h"
#include "url/gurl.h"
namespace dom_distiller {
namespace {
std::string GetLastSegment(const std::string& path) { … }
int CountMatches(const std::string& s, const std::string& p) { … }
int GetWordCount(const std::string& s) { … }
bool Contains(const std::string& n, const std::string& h) { … }
bool EndsWith(const std::string& t, const std::string& s) { … }
}
int kDerivedFeaturesCount = …;
std::vector<double> CalculateDerivedFeatures(bool isOGArticle,
const GURL& url,
double numElements,
double numAnchors,
double numForms,
const std::string& innerText,
const std::string& textContent,
const std::string& innerHTML) { … }
std::vector<double> CalculateDerivedFeaturesFromJSON(
const base::Value* stringified_json) { … }
std::vector<double> CalculateDerivedFeatures(bool openGraph,
const GURL& url,
unsigned elementCount,
unsigned anchorCount,
unsigned formCount,
double mozScore,
double mozScoreAllSqrt,
double mozScoreAllLinear) { … }
}