|
FOSSredder 0.5.0
|
Implements draft matching policy helpers for import-time inference. More...
#include "core/pch.h"#include "core/domain/policies/DraftMatchingPolicy.h"#include "../../utils/StringUtils.h"#include <algorithm>#include <cctype>#include <cmath>#include <limits>#include <regex>#include <sstream>#include <utility>
Go to the source code of this file.
Namespaces | |
| namespace | core |
| namespace | core::domain |
| namespace | core::domain::policies |
| namespace | core::domain::policies::matching |
Functions | |
| std::string | core::domain::policies::matching::trim (std::string value) |
| Trims whitespace from raw text. | |
| bool | core::domain::policies::matching::matchesDraftText (const std::string &left, const std::string &right) |
| Compares two pieces of draft text after normalization. | |
| std::vector< std::string > | core::domain::policies::matching::splitLines (const std::string &text) |
| Splits text into non-empty normalized lines. | |
| std::string | core::domain::policies::matching::joinNonEmptyLines (const std::vector< std::string > &values, const std::string &separator) |
| Joins non-empty lines with a separator. | |
| bool | core::domain::policies::matching::lineLooksMetadataBoundary (const std::string &line) |
| Checks whether a line looks like a metadata boundary. | |
| bool | core::domain::policies::matching::lineLooksActorStopSignal (const std::string &line) |
| Checks whether a line should stop actor extraction. | |
| bool | core::domain::policies::matching::lineLooksActorContinuation (const std::string &line) |
| Checks whether a line can continue actor extraction. | |
| std::string | core::domain::policies::matching::firstMeaningfulLine (const std::string &text) |
| Returns the first meaningful line of text. | |
| std::string | core::domain::policies::matching::leadingPhrase (const std::string &text, std::size_t maxTokens) |
| Extracts a leading phrase from text. | |
| std::string | core::domain::policies::matching::normalizeText (std::string text) |
| Normalizes draft text for matching. | |
| std::vector< std::string > | core::domain::policies::matching::tokens (const std::string &text) |
| Splits normalized text into tokens. | |
| std::string | core::domain::policies::matching::leadingText (const std::string &text, std::size_t maxTokens) |
| Returns a leading slice of the normalized text. | |
| bool | core::domain::policies::matching::tokenIsMatchable (const std::string &token) |
| Checks whether a token is useful for matching. | |
| int | core::domain::policies::matching::tokenOverlapScore (const std::vector< std::string > &sourceTokens, const std::vector< std::string > &targetTokens) |
| Scores token overlap between two token lists. | |
| double | core::domain::policies::matching::aliasHitWeight (int hitCount) |
| Computes a score weight from alias hit count. | |
| double | core::domain::policies::matching::aliasRecencyWeight (const std::string &lastUsedAt) |
| Computes a score weight from alias recency. | |
| std::string | core::domain::policies::matching::metadataSignalText (const std::string &metadata) |
| Normalizes metadata into signal text. | |
| std::vector< std::string > | core::domain::policies::matching::referenceAliasesFromMetadata (const std::string &metadata) |
| Extracts reference-like aliases from metadata. | |
| std::vector< std::string > | core::domain::policies::matching::knownContractTypes (const core::domain::catalog::WorkspaceCatalog &state) |
| Collects known contract types from the workspace state. | |
| std::string | core::domain::policies::matching::extractTypeText (const core::domain::catalog::WorkspaceCatalog &state, const std::string &signalText, const std::vector< std::string > &lines) |
| Extracts a contract type hint from draft text. | |
| std::string | core::domain::policies::matching::extractActorText (const std::vector< std::string > &lines, const std::string &typeText) |
| Extracts an actor hint from draft text. | |
Implements draft matching policy helpers for import-time inference.
Shared draft matching and parsing helpers.
Definition in file DraftMatchingPolicy.cpp.