kiraz cevik

Greenhorn
since Nov 21, 2019
Cows and Likes
Cows
0
In last 30 days
0
Total given
0
Likes
0
0
Total given
2
Given in last 30 days
2
Scavenger Hunt
Ranch Hand Scavenger Hunt
Greenhorn Scavenger Hunt

Recent posts by kiraz cevik

[quoted text removed]

Thank you very much for your help.
2 weeks ago

Piet Souris wrote:

kiraz cevik wrote:Since Q is in the English alphabet, it's like you wrote it.It is true

But that leads to problems. In your language the Q is missing, so you would interprete [P-S] as [P. R, S], but in the west we would interprete this as [P, Q, R, S]. To prevent problems like this, I suggest that you add the alphabet that is used here, in the correct order. For instance, with such a table and interpreting [P-S] as [P, Q, R, S] we can then see that the Q should not be there. Or maybe an alternative is to define a fixed alphabet that you will use, so that no misundertanding is possible. With one of those possibilities in mind, and suppuse A, B and C are allowed letters, is 1A, 1C possible, or can we rely on letters always being consecutive?

Thanks
[P-Q-R-S]=[P-S] Must be shaped.
You can always rely consecutive letters.
300A, 301B, 302C =[300-302][A-C] no. This has not to be sorted.  Because it's not serial.
I wanted to remind you.
2 weeks ago

kiraz cevik wrote:

Piet Souris wrote:hi Kiraz,
the map that I created was only meant to be an intermediate result. It was my intention to go on processing. My further ideas were:

create an enum

and have new new Class:

Now, I would have a method that processes my intermediate results in the map, and creates a List<FinalToken>. Supose you have this entry in the map:

Because of the empty char at the start of the list (coming from the Token 300 without any chars) I create two FinalTokens: with 300 and type JUST_A_NUMBER, and 300 with list [A, B, C], with type NUMBER_WITH_ChAR.
The last one will output the toString result: 300[A-C].
So I have a List<FinalToken>. My last step is to go from top to bottom, and when I encounter type JUST_A_NUMBER, I will check if the next couple of elements are also of type JUST_A_NUMBER and have consecutive ints. Then I will output the [300 - 350] form.

Well, sounds more complicated than it is (I hope), but I have not yet had time (or courage) to implement all this (well, I do have the enum).

This was what I had in mind. Wondering if others have come up with someting more simple.

Thank you. Do I create an enum class separate from the code you originally wrote?Is the FinalToken class created separately

I am sorry.I'm a beginner in Java, I created the same enum class, but it didn't work.
2 weeks ago

Carey Brown wrote:

Piet Souris wrote:

Carey Brown wrote:I don't understand how P, R, S is a sequence when it is missing the 'Q'.

I asked a question about that. The answer was (if I recall corretly) that these letters are always consecutive. Otherwise I guess it will be even more complex....

I was expecting an output of
201/21P
201/21[R-S]

Since Q is in the English alphabet, it's like you wrote it.It is true
2 weeks ago

Piet Souris wrote:hi Kiraz,
the map that I created was only meant to be an intermediate result. It was my intention to go on processing. My further ideas were:

create an enum

and have new new Class:

Now, I would have a method that processes my intermediate results in the map, and creates a List<FinalToken>. Supose you have this entry in the map:

Because of the empty char at the start of the list (coming from the Token 300 without any chars) I create two FinalTokens: with 300 and type JUST_A_NUMBER, and 300 with list [A, B, C], with type NUMBER_WITH_ChAR.
The last one will output the toString result: 300[A-C].
So I have a List<FinalToken>. My last step is to go from top to bottom, and when I encounter type JUST_A_NUMBER, I will check if the next couple of elements are also of type JUST_A_NUMBER and have consecutive ints. Then I will output the [300 - 350] form.

Well, sounds more complicated than it is (I hope), but I have not yet had time (or courage) to implement all this (well, I do have the enum).

This was what I had in mind. Wondering if others have come up with someting more simple.

Thank you. Do I create an enum class separate from the code you originally wrote?Is the FinalToken class created separately
2 weeks ago

Carey Brown wrote:I don't understand how P, R, S is a sequence when it is missing the 'Q'.

Our alphabet does not have Q but can be added.
2 weeks ago

Piet Souris wrote:I am experimenting with a TreeMap with a suitable Comparator. A bit clumsy right now, but this is how far I am.

code output:
1: [ ]
2: [ , A, B, C]
3: [ , A]
4: [ ]
5: [ ]
6: [ ]
32: [C, D]
50:[]
51/1:[]
51/2:[]
60: [ ]
61: [ ]
62: [ ]
200-2:[E, F, G, H]
201:[C]
201/21:[P, R, S]
300:[ , A]
301-2:[A]
542/2:[K, L]
583-1:[]
583-585:[D, E]
605:[ ,A, B, C]
800:[A]

Why does [] constantly produce it and doesn't merge in range?
How to combine letters in the range as follows?
output:
1
2
2[A-C]
3
3A
[4-6]
32[C-D]
50
51/1
51/2
[60-62]
200-2[E-H]
201C
201/21[P-S]
300
300A
301-2A
542/2[K-L]
583-1
583-585[D-E]
605
605[A-C]
800A

3 weeks ago
Sorted String İnput: 1, 2, 2A, 2B, 2C, 3, 3A, 4, 5, 6, 32C, 32D, 50, 51/1, 51/2, 60, 61, 62, 200-2E, 200-2F, 200-2G, 200-2H, 201C, 201/21P, 201/21R, 201/21S,300,300A,301-2A, 542/2K, 542/2L,583-1, 583-585D, 583-585E, 605, 605A, 605B,605C 800A.
Question is about merging consecutive values into a range. E.g.4,5,6 =[4-6] , 2A, 2B, 2C are consecutive values, so range is 2[A-C]. No other values can be in a range.
• General pattern: number[chars][A-Z]
If chars is present, then they have to be equals() to be in a sequence. If the trailing letter is present, they have to be consecutive to have a sequence
A sequence is then abbreviated using: first + "-" + last
51/1, 52/1, 53/1 ==> not merged
51/1A, 51/1B, 51/1C ==> 51/1[A-C]
51/1A, 52/1B, 53/1C ==> [51-53]/1[A-C]
It should be listed as follows.

output:
1
2
2[A-C]
3
3A
[4-6]
32[C-D]
50
51/1
51/2
[60-62]
200-2[E-H]
201C
201/21[P-S]
300
300A
301-2A
542/2[K-L]
583-1
583-585[D-E]
605
605[A-C]
800A

output= merged: [1, 2, 2A, 2B, 2C, 3, 3A, [4-6], 32C, 32D, 50, 51/1, 51/2, [60-62], 200-2E, 200-2F, 200-2G, 200-2H, 201C, 201/21P, 201/21R, 201/21S, 300,300A,301-2A,542/2K, 542/2L,583-1, 583-585D, 583-585E, 605, 605A, 605B,605C 800A]

3 weeks ago

Piet Souris wrote:I am experimenting with a TreeMap with a suitable Comparator. A bit clumsy right now, but this is how far I am.

I looked at the output of the code.
Close to what I want.
3 weeks ago
There will be no lower case [a-z] after the numbers.
3 weeks ago

Piet Souris wrote:Two other quick questions:

1) are the letters always consequtive? Or can we have, say, 1A, 1C, 1Q?
2) are the letters always in alphabetic order, like 1A, 1B, 1C? Or is 1C, 1A, 1B possible?

Sorry if these questions are already answered, I might have missed them.

the letters always in alphabetic order
3 weeks ago

Junilu Lacar wrote:Piet, by my understanding,

1A, 1C, 1Q would not be merged

1C, 1A,1B ==> 1C, 1[A-B]

exactly
3 weeks ago
I'm sorting the string first.
Then I'm sorting the consecutive.