Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 81ac797b4c | |||
| e9aa60524c | |||
| 7e5ab9f799 | |||
| fc137ebd03 |
20
HISTORY.md
20
HISTORY.md
@@ -4,12 +4,32 @@ Changelog
|
||||
|
||||
(unreleased)
|
||||
------------
|
||||
- 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)
|
||||
------------------
|
||||
|
||||
Fix
|
||||
~~~
|
||||
- Allow for parsing single chars as input, ref: NOISSUE. [Simon
|
||||
Diesenreiter]
|
||||
|
||||
Other
|
||||
~~~~~
|
||||
|
||||
|
||||
0.7.0 (2024-12-05)
|
||||
------------------
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -123,7 +131,7 @@ public abstract class DataSetManipulatorBase<TCollectedType, TDataType, TIndexTy
|
||||
return results;
|
||||
}
|
||||
|
||||
public List<DirectionalSearchResult<TIndexType>> FindInSet(List<TDataType> data)
|
||||
public List<DirectionalSearchResult<TIndexType>> FindInSet(List<TDataType> data, Direction directions)
|
||||
{
|
||||
var result = new List<DirectionalSearchResult<TIndexType>>();
|
||||
|
||||
@@ -131,11 +139,16 @@ public abstract class DataSetManipulatorBase<TCollectedType, TDataType, TIndexTy
|
||||
var startingPoints = this.FindInSet(data[0]);
|
||||
foreach (var startingPoint in startingPoints)
|
||||
{
|
||||
foreach (var results in this.FindAtPosition(startingPoint.DataIndex, data))
|
||||
foreach (var results in this.FindAtPosition(startingPoint.DataIndex, data, directions))
|
||||
{
|
||||
result.AddRange(results);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<DirectionalSearchResult<TIndexType>> FindInSet(List<TDataType> data)
|
||||
{
|
||||
return this.FindInSet(data, this.ValidDirections());
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
0.7.1
|
||||
0.8.0
|
||||
|
||||
Reference in New Issue
Block a user