Setup Git Repository Parsing

This commit is contained in:
Simon Martens
2023-09-10 01:09:20 +02:00
parent 4e3c65dc6f
commit 8fd0050cf3
69 changed files with 1228 additions and 1461 deletions

View File

@@ -6,11 +6,14 @@ using HaWeb.XMLTests;
public class AppNode : INodeRule
{
public string Name => "app";
public string XPath => "//app";
public HamannXPath XPath => new HamannXPath() {
Documents = new[] { "ueberlieferung" },
XPath = "//app"
};
public string[]? Attributes { get; } = { "ref" };
public string? uniquenessAttribute => null;
public List<(string, string, string)>? References { get; } = new List<(string, string, string)>()
public List<(string, HamannXPath, string)>? References { get; } = new List<(string, HamannXPath, string)>()
{
("ref", "//appDef", "index")
("ref", new HamannXPath() { Documents = new[] { "personenorte" }, XPath = "//appDef" }, "index")
};
}

View File

@@ -6,10 +6,13 @@ using HaWeb.XMLTests;
public class AutopsicNode : INodeRule
{
public string Name => "autopsic";
public string XPath => "//autopsic";
public HamannXPath XPath => new HamannXPath() {
Documents = new[] { "metadaten" },
XPath = "//autopsic"
};
public string[]? Attributes { get; } = { "value" };
public string? uniquenessAttribute => "value" ;
public List<(string, string, string)>? References { get; } = new List<(string, string, string)>()
public List<(string, HamannXPath, string)>? References { get; } = new List<(string, HamannXPath, string)>()
{
};
}

View File

@@ -6,11 +6,14 @@ using HaWeb.XMLTests;
public class EditNode : INodeRule
{
public string Name => "edit";
public string XPath => "//edit";
public HamannXPath XPath => new HamannXPath() {
Documents = new[] { "brieftext", "texteingriffe", "ueberlieferung" },
XPath = "//edit"
};
public string[]? Attributes { get; } = { "ref" };
public string? uniquenessAttribute => null;
public List<(string, string, string)>? References { get; } = new List<(string, string, string)>()
public List<(string, HamannXPath, string)>? References { get; } = new List<(string, HamannXPath, string)>()
{
("ref", "//editreason", "index")
("ref", new HamannXPath() { Documents = new[] { "texteingriffe" }, XPath = "//editreason" }, "index")
};
}

View File

@@ -6,11 +6,14 @@ using HaWeb.XMLTests;
public class HandNode : INodeRule
{
public string Name => "hand";
public string XPath => "//hand";
public HamannXPath XPath => new HamannXPath() {
Documents = new[] { "ueberlieferung", "brieftext", "texteingriffe" },
XPath = "//hand"
};
public string[]? Attributes { get; } = { "ref" };
public string? uniquenessAttribute => null;
public List<(string, string, string)>? References { get; } = new List<(string, string, string)>()
public List<(string, HamannXPath, string)>? References { get; } = new List<(string, HamannXPath, string)>()
{
("ref", "//handDef", "index")
("ref", new HamannXPath() { Documents = new[] { "personenorte" }, XPath = "//handDef" }, "index")
};
}

View File

@@ -6,10 +6,13 @@ using HaWeb.XMLTests;
public class KommentarNode : INodeRule
{
public string Name => "kommentar";
public string XPath => "//kommentar";
public HamannXPath XPath => new HamannXPath() {
Documents = new[] { "register" },
XPath = "//kommentar"
};
public string[]? Attributes { get; } = { "id" };
public string? uniquenessAttribute => "id" ;
public List<(string, string, string)>? References { get; } = new List<(string, string, string)>()
public List<(string, HamannXPath, string)>? References { get; } = new List<(string, HamannXPath, string)>()
{
};
}

View File

@@ -6,10 +6,13 @@ using HaWeb.XMLTests;
public class LetterDescNode : INodeRule
{
public string Name => "letterDesc";
public string XPath => "//letterDesc";
public HamannXPath XPath => new HamannXPath() {
Documents = new[] { "metadaten" },
XPath = "//letterDesc"
};
public string[]? Attributes { get; } = { "ref" };
public string? uniquenessAttribute => "ref" ;
public List<(string, string, string)>? References { get; } = new List<(string, string, string)>()
public List<(string, HamannXPath, string)>? References { get; } = new List<(string, HamannXPath, string)>()
{
};
}

View File

@@ -6,10 +6,13 @@ using HaWeb.XMLTests;
public class LetterTextNode : INodeRule
{
public string Name => "letterText";
public string XPath => "//letterText";
public HamannXPath XPath => new HamannXPath() {
Documents = new[] { "brieftext" },
XPath = "//letterText"
};
public string[]? Attributes { get; } = { "index" };
public string? uniquenessAttribute => "index" ;
public List<(string, string, string)>? References { get; } = new List<(string, string, string)>()
public List<(string, HamannXPath, string)>? References { get; } = new List<(string, HamannXPath, string)>()
{
};
}

View File

@@ -6,10 +6,13 @@ using HaWeb.XMLTests;
public class LetterTraditionNode : INodeRule
{
public string Name => "letterTradition";
public string XPath => "//letterTradition";
public HamannXPath XPath => new HamannXPath() {
Documents = new[] { "ueberlieferung" },
XPath = "//letterTradition"
};
public string[]? Attributes { get; } = { "ref" };
public string? uniquenessAttribute => "ref" ;
public List<(string, string, string)>? References { get; } = new List<(string, string, string)>()
public List<(string, HamannXPath, string)>? References { get; } = new List<(string, HamannXPath, string)>()
{
};
}

View File

@@ -6,12 +6,15 @@ using HaWeb.XMLTests;
public class LinkNode : INodeRule
{
public string Name => "link";
public string XPath => "//link";
public HamannXPath XPath => new HamannXPath() {
Documents = new[] { "ueberlieferung", "stellenkommentar", "register", "texteingriffe" },
XPath = "//link"
};
public string[]? Attributes { get; } = null;
public string? uniquenessAttribute => null;
public List<(string, string, string)>? References { get; } = new List<(string, string, string)>()
public List<(string, HamannXPath, string)>? References { get; } = new List<(string, HamannXPath, string)>()
{
("ref", "//kommentar", "id"),
("subref", "//subsection", "id")
("ref", new HamannXPath() { Documents = new[] { "register" }, XPath = "//kommentar" }, "id"),
("subref", new HamannXPath() { Documents = new[] { "register" }, XPath = "//subsection" }, "id"),
};
}

View File

@@ -6,10 +6,13 @@ using HaWeb.XMLTests;
public class MarginalNode : INodeRule
{
public string Name => "marginal";
public string XPath => "//marginal";
public HamannXPath XPath => new HamannXPath() {
Documents = new[] { "stellenkommentar" },
XPath = "//marginal"
};
public string[]? Attributes { get; } = { "index", "letter", "page", "line" };
public string? uniquenessAttribute => "index";
public List<(string, string, string)>? References { get; } = new List<(string, string, string)>()
public List<(string, HamannXPath, string)>? References { get; } = new List<(string, HamannXPath, string)>()
{
};
}

View File

@@ -6,11 +6,14 @@ using HaWeb.XMLTests;
public class Receiver : INodeRule
{
public string Name => "receiver";
public string XPath => "//receiver";
public HamannXPath XPath => new HamannXPath() {
Documents = new[] { "metadaten" },
XPath = "//receiver"
};
public string[]? Attributes { get; } = { "ref" };
public string? uniquenessAttribute => null;
public List<(string, string, string)>? References { get; } = new List<(string, string, string)>()
public List<(string, HamannXPath, string)>? References { get; } = new List<(string, HamannXPath, string)>()
{
("ref", "//personDef", "index")
("ref", new HamannXPath() { Documents = new[] { "personenorte" }, XPath = "//personDef" }, "index")
};
}

View File

@@ -6,11 +6,14 @@ using HaWeb.XMLTests;
public class SenderNode : INodeRule
{
public string Name => "sender";
public string XPath => "//sender";
public HamannXPath XPath => new HamannXPath() {
Documents = new[] { "metadaten" },
XPath = "//sender"
};
public string[]? Attributes { get; } = { "ref" };
public string? uniquenessAttribute => null;
public List<(string, string, string)>? References { get; } = new List<(string, string, string)>()
public List<(string, HamannXPath, string)>? References { get; } = new List<(string, HamannXPath, string)>()
{
("ref", "//personDef", "index")
("ref", new HamannXPath() { Documents = new[] { "personenorte" }, XPath = "//personDef" }, "index")
};
}

View File

@@ -5,8 +5,15 @@ namespace HaWeb.Settings.NodeRules;
public class StructureCollection : ICollectionRule {
public string Name { get; } = "structure";
public string[] Bases { get; } = { "//letterText", "//letterTradition" };
public string[] Backlinks { get; } = { "//intlink", "//marginal" };
public HamannXPath[] Bases { get; } = {
new HamannXPath() { Documents = new[] { "brieftext" }, XPath = "//letterText" },
new HamannXPath() { Documents = new[] { "ueberlieferung" }, XPath = "//letterTradition"}
};
public HamannXPath[] Backlinks { get; } = {
new HamannXPath() { Documents = new[] { "stellenkommentar", "ueberlieferung", "texteingriffe", "register" }, XPath = "//intlink" },
new HamannXPath() { Documents = new[] { "stellenkommentar" }, XPath = "//marginal"}
};
public IEnumerable<(string, XElement, XMLRootDocument)> GenerateIdentificationStrings(IEnumerable<(XElement, XMLRootDocument)> list) {
foreach (var e in list) {
var id = e.Item1.Name == "letterText" ? e.Item1.Attribute("index")!.Value : e.Item1.Attribute("ref")!.Value;

View File

@@ -6,10 +6,13 @@ using HaWeb.XMLTests;
public class SubsectionNode : INodeRule
{
public string Name => "subsection";
public string XPath => "//subsection";
public HamannXPath XPath => new HamannXPath() {
Documents = new[] { "register" },
XPath = "//subsection"
};
public string[]? Attributes { get; } = { "id" };
public string? uniquenessAttribute => "id" ;
public List<(string, string, string)>? References { get; } = new List<(string, string, string)>()
public List<(string, HamannXPath, string)>? References { get; } = new List<(string, HamannXPath, string)>()
{
};
}