6 Commits
0.7.2 ... 0.9.1

Author SHA1 Message Date
2fbdafa0e9 release: version 0.9.1 🚀
Some checks failed
Upload Python Package / Create Release (push) Successful in 19s
Upload Python Package / deploy (push) Failing after 4m4s
2024-12-13 13:23:06 +01:00
f942954678 fix: fix build issues, ref: NOISSUE 2024-12-13 13:23:02 +01:00
4c67e8efb0 release: version 0.9.0 🚀
Some checks failed
Upload Python Package / Create Release (push) Successful in 17s
Upload Python Package / deploy (push) Failing after 4m23s
2024-12-13 13:13:50 +01:00
e83e99758a feat: add filter option to TokenConverter, ref: NOISSUE 2024-12-13 13:13:43 +01:00
81ac797b4c release: version 0.8.0 🚀
Some checks failed
Upload Python Package / Create Release (push) Successful in 17s
Upload Python Package / deploy (push) Failing after 4m6s
2024-12-12 20:03:14 +01:00
e9aa60524c feat: adding sensible index constructors refs: NOISSUE 2024-12-12 20:03:07 +01:00
7 changed files with 80 additions and 9 deletions

View File

@@ -5,10 +5,33 @@ Changelog
(unreleased)
------------
Fix
~~~
- Fix build issues, ref: NOISSUE. [Simon Diesenreiter]
0.9.0 (2024-12-13)
------------------
- Feat: add filter option to TokenConverter, ref: NOISSUE. [Simon
Diesenreiter]
0.8.0 (2024-12-12)
------------------
- Feat: adding sensible index constructors refs: NOISSUE. [Simon
Diesenreiter]
0.7.2 (2024-12-05)
------------------
Fix
~~~
- Add some missing API methods, ref: NOISSUE. [Simon Diesenreiter]
Other
~~~~~
0.7.1 (2024-12-05)
------------------

View File

@@ -20,4 +20,24 @@ public static class DataManipulationHelpers
{
return reducer(data);
}
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)
{
newList.Add(transformer(dataItem));
}
return newList;
}
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)
{
newList.Add(transformer(dataItemList));
}
return newList;
}
}

View File

@@ -4,11 +4,22 @@ namespace Parsing.Data;
public class SearchResult<TIndexType>
{
public SearchResult(IDataIndex<TIndexType> dataIndex)
{
this.DataIndex = dataIndex;
}
public IDataIndex<TIndexType>? DataIndex { get; set; }
}
public class DirectionalSearchResult<TIndexType> : SearchResult<TIndexType>
{
public DirectionalSearchResult(IDataIndex<TIndexType> dataIndex, Direction direction, int length): base(dataIndex)
{
this.Direction = direction;
this.Length = length;
}
public Direction Direction { get; set; }
public int Length { get; set; }
}
@@ -111,10 +122,7 @@ public abstract class DataSetManipulatorBase<TCollectedType, TDataType, TIndexTy
}
if (searchIndex == data.Count)
{
var result = new DirectionalSearchResult<TIndexType>();
result.DataIndex = currentPosition;
result.Direction = direction;
result.Length = searchIndex;
var result = new DirectionalSearchResult<TIndexType>(currentPosition, direction, searchIndex);
results.Add(result);
}
}

View File

@@ -49,8 +49,7 @@ public class DefaultOneDimensionalManipulator<TDataType> : DataSetManipulatorBas
{
if (EqualityComparer<TDataType>.Default.Equals(this.dataSet[i], data))
{
var singleResult = new SearchResult<int>();
singleResult.DataIndex = new DefaultPositionalDataIndex(i);
var singleResult = new SearchResult<int>(new DefaultPositionalDataIndex(i));
results.Add(singleResult);
}
}

View File

@@ -71,8 +71,7 @@ public class DefaultTwoDimensionalManipulator<TDataType> : DataSetManipulatorBas
{
if (EqualityComparer<TDataType>.Default.Equals(this.dataSet[this.dataSet.Count - y - 1][x], data))
{
var singleResult = new SearchResult<int>();
singleResult.DataIndex = new DefaultPositionalDataIndex(x, y);
var singleResult = new SearchResult<int>(new DefaultPositionalDataIndex(x, y));
results.Add(singleResult);
}
}

View File

@@ -156,4 +156,26 @@ public class TokenConverter
return newList;
}
public TokenConverter Filter<T>(params InputType[] inputTypes)
{
var newTokenListList = new List<List<IToken>>();
foreach(var tokenList in rawTokens)
{
var newTokenList = new List<IToken>();
foreach(var token in tokenList)
{
if(inputTypes.Contains(token.GetInputType()))
{
newTokenList.Add(token);
}
}
newTokenListList.Add(newTokenList);
}
this.rawTokens = newTokenListList;
return this;
}
}

View File

@@ -1 +1 @@
0.7.2
0.9.1