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.
36 lines
875 B
C#
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);
|
|
}
|
|
}
|