Files
Rafał Tyński bad37a6ab9 feat(backend): add knowledge base, innovation library and trends modules
Add knowledge item and innovation CRUD with search/filtering, published-only visibility for non-staff, admin publish/update, challenge dictionary, problem aggregation with trends (admin only) and canonical embedding text preparation for matchmaking.
2026-10-04 02:32:33 +02:00

36 lines
875 B
C#

namespace TarninaHub.Application.Text;
/// <summary>
/// Builds the canonical text used to compute an innovation embedding
/// (matchmaking, steps 14-15).
/// </summary>
public static class EmbeddingTextBuilder
{
public static string Build(string title, string? summary, string? description, string? challengeName = null)
{
var parts = new List<string>();
if (!string.IsNullOrWhiteSpace(title))
{
parts.Add(title.Trim());
}
if (!string.IsNullOrWhiteSpace(summary))
{
parts.Add(summary.Trim());
}
if (!string.IsNullOrWhiteSpace(description))
{
parts.Add(description.Trim());
}
if (!string.IsNullOrWhiteSpace(challengeName))
{
parts.Add(challengeName.Trim());
}
return string.Join("\n", parts);
}
}