Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cc0f0a24d9 | |||
| c41d665ab8 | |||
| 2fbdafa0e9 | |||
| f942954678 | |||
| 4c67e8efb0 | |||
| e83e99758a | |||
| 81ac797b4c | |||
| e9aa60524c |
34
HISTORY.md
34
HISTORY.md
@@ -5,10 +5,44 @@ Changelog
|
||||
(unreleased)
|
||||
------------
|
||||
|
||||
Fix
|
||||
~~~
|
||||
- More bugfixes, ref: NOISSUE. [Simon Diesenreiter]
|
||||
|
||||
|
||||
0.9.1 (2024-12-13)
|
||||
------------------
|
||||
|
||||
Fix
|
||||
~~~
|
||||
- Fix build issues, ref: NOISSUE. [Simon Diesenreiter]
|
||||
|
||||
Other
|
||||
~~~~~
|
||||
|
||||
|
||||
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)
|
||||
------------------
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,4 +156,26 @@ public class TokenConverter
|
||||
|
||||
return newList;
|
||||
}
|
||||
|
||||
public TokenConverter Filter(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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
0.7.2
|
||||
0.9.2
|
||||
|
||||
Reference in New Issue
Block a user