Compare commits
16 Commits
414c74be84
...
0.11.6
| Author | SHA1 | Date | |
|---|---|---|---|
| f6701df12d | |||
| 610b628081 | |||
| f480334eee | |||
| 8608e4ddd1 | |||
| 7133ec1560 | |||
| 2f92f59a50 | |||
| 97a4da7531 | |||
| c577f15f91 | |||
| b4d55ddfc0 | |||
| f51aad91fa | |||
| cab7ac35ae | |||
| 86bb120e32 | |||
| c728509978 | |||
| 7bd2429a43 | |||
| d41d9f1791 | |||
| 1a8a82c106 |
@@ -59,10 +59,14 @@ jobs:
|
||||
REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_')
|
||||
REPOSITORY_SOURCE_NAME=gitea-repo
|
||||
if [ -z "$(dotnet nuget config get all | grep "/packages/${REPOSITORY_OWNER}/nuget/index.json")" ]; then
|
||||
echo "source repo not configured yet"
|
||||
dotnet nuget add source --name $REPOSITORY_SOURCE_NAME https://git.disi.dev/api/packages/$REPOSITORY_OWNER/nuget/index.json
|
||||
else
|
||||
echo "Picking correct source repo"
|
||||
QUOTED_REPOSITORY_SOURCE_NAME=$(dotnet nuget config get all | grep "/packages/${REPOSITORY_OWNER}/nuget/index.json" | awk '{print $2}' | awk -F= '{print $2}')
|
||||
REPOSITORY_SOURCE_NAME=${QUOTED_REPOSITORY_SOURCE_NAME:1:-1}
|
||||
REPOSITORY_SOURCE_NAME=${QUOTED_REPOSITORY_SOURCE_NAME:1:-2}
|
||||
echo "chosen repo is $REPOSITORY_SOURCE_NAME"
|
||||
fi
|
||||
dotnet pack --include-symbols --include-source -p:PackageVersion=$(cat $REPOSITORY_NAME/VERSION) TextParser.sln
|
||||
echo "dotnet nuget push -k <GITEA_PAT> --source $REPOSITORY_SOURCE_NAME $REPOSITORY_NAME/bin/Release/$REPOSITORY_NAME.$(cat $REPOSITORY_NAME/VERSION).symbols.nupkg"
|
||||
dotnet nuget push -k $GITEA_PAT --source $REPOSITORY_SOURCE_NAME $REPOSITORY_NAME/bin/Release/$REPOSITORY_NAME.$(cat $REPOSITORY_NAME/VERSION).symbols.nupkg
|
||||
|
||||
77
HISTORY.md
77
HISTORY.md
@@ -4,6 +4,83 @@ Changelog
|
||||
|
||||
(unreleased)
|
||||
------------
|
||||
|
||||
Fix
|
||||
~~~
|
||||
- Bugfix, refs NOISSUE. [Simon Diesenreiter]
|
||||
|
||||
|
||||
0.11.5 (2025-10-26)
|
||||
-------------------
|
||||
|
||||
Fix
|
||||
~~~
|
||||
- Fix default push NuGet source, refs NOISSUE. [Simon Diesenreiter]
|
||||
|
||||
Other
|
||||
~~~~~
|
||||
|
||||
|
||||
0.11.4 (2025-10-26)
|
||||
-------------------
|
||||
|
||||
Fix
|
||||
~~~
|
||||
- Set default push NuGet source, refs NOISSUE. [Simon Diesenreiter]
|
||||
|
||||
Other
|
||||
~~~~~
|
||||
|
||||
|
||||
0.11.3 (2025-10-26)
|
||||
-------------------
|
||||
|
||||
Fix
|
||||
~~~
|
||||
- Reenable all NuGet sources, refs NOISSUE. [Simon Diesenreiter]
|
||||
|
||||
Other
|
||||
~~~~~
|
||||
|
||||
|
||||
0.11.2 (2025-10-26)
|
||||
-------------------
|
||||
|
||||
Fix
|
||||
~~~
|
||||
- Even more debug output during releases, refs NOISSUE. [Simon
|
||||
Diesenreiter]
|
||||
|
||||
Other
|
||||
~~~~~
|
||||
|
||||
|
||||
0.11.1 (2025-10-26)
|
||||
-------------------
|
||||
|
||||
Fix
|
||||
~~~
|
||||
- More debug output during releases, refs NOISSUE. [Simon Diesenreiter]
|
||||
|
||||
Other
|
||||
~~~~~
|
||||
- Ci: reenable one of the NuGet sources, refs NOISSUE. [Simon
|
||||
Diesenreiter]
|
||||
|
||||
|
||||
0.11.0 (2025-10-26)
|
||||
-------------------
|
||||
- Revert "feat: add two dimensional data walker, refs: NOISSUE" [Simon
|
||||
Diesenreiter]
|
||||
|
||||
This reverts commit 414c74be84aecd3aff2f7abbb6cab88f50034d84.
|
||||
- Ci: disable nuget feeds for now, refs NOISSUE. [Simon Diesenreiter]
|
||||
- Feat: add two dimensional data walker, refs: NOISSUE. [Simon
|
||||
Diesenreiter]
|
||||
|
||||
|
||||
0.10.0 (2024-12-13)
|
||||
-------------------
|
||||
- Feat: add support for custom token types and longs, ref: NOISSUE.
|
||||
[Simon Diesenreiter]
|
||||
|
||||
|
||||
@@ -5,32 +5,44 @@ using Parsing.Tokenization;
|
||||
|
||||
public static class DataConversionHelpers
|
||||
{
|
||||
public static List<TNewType> ConvertData<TNewType, TOldType>(this List<TOldType> valueList, Func<TOldType, TNewType> converter)
|
||||
public static List<TNewType> ConvertData<TTokenType, TNewType, TOldType>(this List<IToken> tokenList, Func<TOldType, TNewType> converter) where TTokenType : IValueToken<TOldType>
|
||||
{
|
||||
var newList = new List<TNewType>();
|
||||
foreach (var value in valueList)
|
||||
foreach (var token in tokenList)
|
||||
{
|
||||
newList.Add(converter(value));
|
||||
var typedToken = token as IValueToken<TOldType>;
|
||||
if (typedToken == null)
|
||||
{
|
||||
throw new Exception("Invalid Token type encountered during value conversion");
|
||||
}
|
||||
|
||||
newList.Add(converter(typedToken.GetValue()));
|
||||
}
|
||||
return newList;
|
||||
}
|
||||
|
||||
public static List<TNewType> ConvertData<TNewType, TOldType>(this List<TOldType> valueList, Func<TOldType, List<TNewType>> converter)
|
||||
public static List<TNewType> ConvertData<TTokenType, TNewType, TOldType>(this List<IToken> tokenList, Func<TOldType, List<TNewType>> converter) where TTokenType : IValueToken<TOldType>
|
||||
{
|
||||
var newList = new List<TNewType>();
|
||||
foreach (var value in valueList)
|
||||
foreach (var token in tokenList)
|
||||
{
|
||||
newList.AddRange(converter(value));
|
||||
var typedToken = token as IValueToken<TOldType>;
|
||||
if (typedToken == null)
|
||||
{
|
||||
throw new Exception("Invalid Token type encountered during value conversion");
|
||||
}
|
||||
|
||||
newList.AddRange(converter(typedToken.GetValue()));
|
||||
}
|
||||
return newList;
|
||||
}
|
||||
|
||||
public static List<List<TNewType>> ConvertData<TNewType, TOldType>(this List<List<TOldType>> valueListList, Func<TOldType, TNewType> converter)
|
||||
public static List<List<TNewType>> ConvertData<TTokenType, TNewType, TOldType>(this List<List<IToken>> tokenListList, Func<TOldType, TNewType> converter) where TTokenType : IValueToken<TOldType>
|
||||
{
|
||||
var newListList = new List<List<TNewType>>();
|
||||
foreach (var valueList in valueListList)
|
||||
foreach (var tokenList in tokenListList)
|
||||
{
|
||||
newListList.Add(valueList.ConvertData<TNewType, TOldType>(converter));
|
||||
newListList.Add(tokenList.ConvertData<TTokenType, TNewType, TOldType>(converter));
|
||||
}
|
||||
return newListList;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ public static class DataManipulationHelpers
|
||||
return reducer(data);
|
||||
}
|
||||
|
||||
public static List<TNewType> TransformData<TType, TNewType>(this IEnumerable<TType> data, Func<TType, TNewType> transformer)
|
||||
public static List<TNewType> TransformData<TType, TNewType>(this List<TType> data, Func<TType, TNewType> transformer)
|
||||
{
|
||||
var newList = new List<TNewType>();
|
||||
foreach (TType dataItem in data)
|
||||
@@ -31,7 +31,7 @@ public static class DataManipulationHelpers
|
||||
return newList;
|
||||
}
|
||||
|
||||
public static List<TNewType> TransformData<TType, TNewType>(this IEnumerable<IEnumerable<TType>> data, Func<List<TType>, TNewType> transformer)
|
||||
public static List<TNewType> TransformData<TType, TNewType>(this List<List<TType>> data, Func<List<TType>, TNewType> transformer)
|
||||
{
|
||||
var newList = new List<TNewType>();
|
||||
foreach (List<TType> dataItemList in data)
|
||||
@@ -40,21 +40,4 @@ public static class DataManipulationHelpers
|
||||
}
|
||||
return newList;
|
||||
}
|
||||
|
||||
public static List<List<TType>> IterateData<TType>(this List<List<TType>> data, Action<TType, int, int> iterator)
|
||||
{
|
||||
int y = data.Count;
|
||||
foreach(var rowList in data)
|
||||
{
|
||||
y--;
|
||||
int x = 0;
|
||||
foreach(var item in rowList)
|
||||
{
|
||||
iterator(item, x, y);
|
||||
x++;
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -98,8 +98,6 @@ public abstract class DataSetManipulatorBase<TCollectedType, TDataType, TIndexTy
|
||||
// we do not know how to iterate a specific data set exactly, but we only need to find specific items to be able to continue with any other algorithm
|
||||
public abstract List<SearchResult<TIndexType>> FindInSet(TDataType data);
|
||||
|
||||
public abstract List<SearchResult<TIndexType>> GetAllItems();
|
||||
|
||||
public List<DirectionalSearchResult<TIndexType>> FindAtPosition(IDataIndex<TIndexType> currentPosition, List<TDataType> data)
|
||||
{
|
||||
return this.FindAtPosition(currentPosition, data, this.ValidDirections());
|
||||
|
||||
@@ -61,22 +61,6 @@ public class DefaultTwoDimensionalManipulator<TDataType> : DataSetManipulatorBas
|
||||
}
|
||||
}
|
||||
|
||||
public override List<SearchResult<TIndexType>> GetAllItems()
|
||||
{
|
||||
var results = new List<SearchResult<int>>();
|
||||
|
||||
for (int y = 0; y < this.dataSet.Count; y++)
|
||||
{
|
||||
for (int x = 0; x < this.dataSet[this.dataSet.Count - y - 1].Count; x++)
|
||||
{
|
||||
var singleResult = new SearchResult<int>(new DefaultPositionalDataIndex(x, y));
|
||||
results.Add(singleResult);
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
public override List<SearchResult<int>> FindInSet(TDataType data)
|
||||
{
|
||||
var results = new List<SearchResult<int>>();
|
||||
|
||||
@@ -28,9 +28,9 @@ public class TokenConverter
|
||||
|
||||
if (!token.GetType().IsAssignableTo(typeof(IValueToken<U>)))
|
||||
{
|
||||
Console.WriteLine("Token: " + token.GetText());
|
||||
Console.WriteLine(token.GetText());
|
||||
Type t = token.GetType();
|
||||
throw new Exception("Provided token is not a ValueToken - type: " + t.ToString() + " assigned to " + typeof(IValueToken<U>).ToString());
|
||||
throw new Exception("Provided token is not a ValueToken - type: " + t.ToString());
|
||||
}
|
||||
|
||||
IValueToken<U> valueToken = token as IValueToken<U>;
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
var manipulator = DefaultTwoDimensionalManipulator.Create(row);
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using Parsing.Data;
|
||||
|
||||
namespace Parsing.Data;
|
||||
|
||||
public static class TwoDimensionalDataWalker
|
||||
{
|
||||
public static TwoDimensionalDataWalker<TDataType> Create<TDataType>(List<List<TDataType>> dataSet) where TDataType : IEquatable<TDataType>
|
||||
{
|
||||
return new TwoDimensionalDataWalker<TDataType>(dataSet);
|
||||
}
|
||||
}
|
||||
|
||||
public class TwoDimensionalDataWalker<TDataType> where TDataType : IEquatable<TDataType>
|
||||
{
|
||||
private List<List<TDataType>> dataSet
|
||||
|
||||
private Func<TDataType, bool> startCondition;
|
||||
private TDataType startValue;
|
||||
private bool startValueSet = false;
|
||||
private Func<List<TDataType>, TDataType, bool> walkCondition;
|
||||
private Func<List<TDataType>, TDataType, bool> endCondition;
|
||||
private Direction directions;
|
||||
private DefaultTwoDimenstionalManipulator<TDataType> manipulator;
|
||||
|
||||
public TwoDimensionalDataWalker(List<List<TDataType>> dataSet)
|
||||
{
|
||||
this.dataSet = dataSet;
|
||||
this.manipulator = DefaultTwoDimenstionalManipulator.Create(dataSet);
|
||||
}
|
||||
|
||||
public TwoDimensionalDataWalker<TDataType> WithStartCondition(Func<TDataType, bool> startCondition)
|
||||
{
|
||||
this.startCondition = startCondition;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TwoDimensionalDataWalker<TDataType> WithStartValue(TDataType startValue)
|
||||
{
|
||||
this.startValue = startValue;
|
||||
this.startValueSet = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TwoDimensionalDataWalker<TDataType> WithStepCondition(Func<List<TDataType>, TDataType, bool> stepCondition)
|
||||
{
|
||||
this.stepCondition = stepCondition;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TwoDimensionalDataWalker<TDataType> WithEndCondition(Func<List<TDataType>, TDataType, bool> endCondition)
|
||||
{
|
||||
this.endCondition = endCondition;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TwoDimensionalDataWalker<TDataType> WithDirections(Direction directions)
|
||||
{
|
||||
this.directions = directions;
|
||||
return this;
|
||||
}
|
||||
|
||||
private List<List<DirectionalSearchResult<int>>> WalkFromSingleStartPosition(SearchResult<int> start)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public List<List<DirectionalSearchResult<int>>> Walk()
|
||||
{
|
||||
List<SearchResult<int>> startingPoints;
|
||||
|
||||
if(this.startValueSet)
|
||||
{
|
||||
startingPoints = manipulator.FindInSet(this.startValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
startingPoints = manipulator.GetAllItems();
|
||||
}
|
||||
|
||||
var allFoundPaths = new List<List<DirectionalSearchResult<int>>>();
|
||||
|
||||
foreach(var startingPoint in startingPoints)
|
||||
{
|
||||
allFoundPaths.AddRange(this.WalkFromSingleStartPosition(startingPoint));
|
||||
}
|
||||
return allFoundPaths;
|
||||
}
|
||||
}
|
||||
@@ -28,17 +28,17 @@ class StringBlock : BuildingBlockBase
|
||||
public override bool CanParseWord(string word)
|
||||
{
|
||||
// Here we need to ensure we are not matching any non-string tokens, since string can match pretty much anything
|
||||
// LongBlock longBlock = new LongBlock();
|
||||
// if (longBlock.CanParseWord(word))
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
LongBlock longBlock = new LongBlock();
|
||||
if (longBlock.CanParseWord(word))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// IntegerBlock intBlock = new IntegerBlock();
|
||||
// if (intBlock.CanParseWord(word))
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
IntegerBlock intBlock = new IntegerBlock();
|
||||
if (intBlock.CanParseWord(word))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
0.10.0
|
||||
0.11.6
|
||||
|
||||
@@ -8,4 +8,8 @@
|
||||
<add key="gitea-homelab" value="https://git.disi.dev/api/packages/Homelab/nuget/index.json" />
|
||||
<add key="gitea-artifacts" value="https://git.disi.dev/api/packages/Artifacts/nuget/index.json" />
|
||||
</packageSources>
|
||||
|
||||
<config>
|
||||
<add key="DefaultPushSource" value="https://git.disi.dev/api/packages/Projects/nuget/index.json" />
|
||||
</config>
|
||||
</configuration>
|
||||
|
||||
Reference in New Issue
Block a user