Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simplest possible left and right "stairs" converters for sequences. #30

Open
Konard opened this issue Jul 4, 2023 · 0 comments
Open
Labels
enhancement New feature or request help wanted Extra attention is needed sweep

Comments

@Konard
Copy link
Member

Konard commented Jul 4, 2023

image

image

Do not use ∅, pictures are wrong.

The correct source example is:

[1, 2, 3, 4]

Two ways to transform this into sequences

DescendingVariantConverter

This converter starts with a pair of two first elements and the goes "down the hill".

(((1 2) 3) 4)

Where (1 2) means, that it's ID used to make next pair and so on.

var doubletId = _links.GetOrCreate(sequence[0], sequence[1])

AscendingVariantConverter

In that case, converter starts from the end of list/sequence/array.

The complete result will be:

(1 (2 (3 4)))

Where (3 4) means, that it's ID used to make next pair and so on.

var doubletId = _links.GetOrCreate(sequence[i-1], sequence[i])

P.S.

Both sequences should be created at ./csharp/Platform.Data.Doublets.Sequences/Converters folder.

@Konard Konard added enhancement New feature or request help wanted Extra attention is needed labels Jul 4, 2023
@Konard Konard added the sweep label Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed sweep
Projects
None yet
Development

No branches or pull requests

1 participant