Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/AI_Brain / services/knowledge_pipeline.cs |
| Date | Not specified in source |
| Repository | Janady13/AI_Brain |
| Revision | 6d0767aad08781eb5c4e1eb14a42ec92c437be78 |
| Branch | copilot/convert-python-files-to-csharp |
| Path or archive member | services/knowledge_pipeline.cs |
| Original SHA-256 | ed72d6e35c49255aaeaeae2413e13b09d29f5dce24b4f8bd733f978648c533ce |
| Git blob SHA | ae33a3235840aa4329187d09bf9b93f11500c848 |
| Reading-copy SHA-256 | ed72d6e35c49255aaeaeae2413e13b09d29f5dce24b4f8bd733f978648c533ce |
Recovered source transcript
Download complete source text ↓54 lines · 1.2 KB
// Knowledge pipeline for processing atomic facts
using System;
using System.Collections.Generic;
using System.Linq;
namespace AIBrain.Services
{
public class KnowledgePipeline
{
private List<string> facts;
public KnowledgePipeline()
{
facts = new List<string>();
}
public void AddFact(string fact)
{
if (!string.IsNullOrWhiteSpace(fact))
{
facts.Add(fact.Trim());
}
}
public List<string> GetFacts()
{
return new List<string>(facts);
}
public int Count => facts.Count;
public List<string> SearchFacts(string query)
{
return facts.Where(f => f.Contains(query, StringComparison.OrdinalIgnoreCase)).ToList();
}
public void ClearFacts()
{
facts.Clear();
}
public Dictionary<string, object> GetStatistics()
{
return new Dictionary<string, object>
{
["total_facts"] = facts.Count,
["unique_facts"] = new HashSet<string>(facts).Count,
["avg_length"] = facts.Count > 0 ? facts.Average(f => f.Length) : 0
};
}
}
}