evolutionsoftswiss / pokernow-handhistory-converter

Java program to convert pokernow.club logs to Pokerstars handhistories for Usage in known Poker Statistic programs.
13 stars 5 forks source link

Mac: Error on Usernames containing certain characters (e.g. "$") #4

Closed benstuart0 closed 3 years ago

benstuart0 commented 3 years ago

I ran into this error before, didn't want to really deal with it so I downloaded the source code and added a try/catch within the normalizePlayerNames method.

(base) Ben@Bens-Macbook handhistory-converter-0.2.1-program % java -jar handhistory-converter-0.2.1-jar-with-dependencies.jar

23:13:28.559 [main] INFO - Using source folder with pokernow csv histories /Users/Ben/Documents/PokerNow/rawPokerNowHands 23:13:28.564 [main] INFO - Using readYourHoleCards true 23:13:28.564 [main] INFO - Using yourUniqueName benstu 23:13:28.566 [main] INFO - Using currencyFactor 1.0 23:13:28.566 [main] INFO - Using convertOmahaHighHands true 23:13:28.566 [main] INFO - Using convertOmahaHiLoHands true 23:13:28.566 [main] INFO - Using convertTexasHands true 23:13:28.566 [main] INFO - Using destination folder for converted hond histories /Users/Ben/Documents/PokerNow/convertedPokerNowHands Exception in thread "main" java.lang.IllegalArgumentException: Illegal group reference: group index is missing at java.base/java.util.regex.Matcher.appendExpandedReplacement(Matcher.java:1030) at java.base/java.util.regex.Matcher.appendReplacement(Matcher.java:998) at java.base/java.util.regex.Matcher.replaceAll(Matcher.java:1182) at java.base/java.lang.String.replaceAll(String.java:2126) at ch.evolutionsoft.poker.pokernow.PokernowHandHistoryConverter.normalizePlayerNames(PokernowHandHistoryConverter.java:357) at ch.evolutionsoft.poker.pokernow.PokernowHandHistoryConverter.convertHandHistory(PokernowHandHistoryConverter.java:271) at ch.evolutionsoft.poker.pokernow.PokernowHandHistoryConverter.main(PokernowHandHistoryConverter.java:92)

evolutionsoftswiss commented 3 years ago

I can reproduce that well. The player name normalization is based on a regular expression and characters like $ or also parantheses and other special regex chars cause problems when they are not mapped. It's not easy to fix completely without loosing the regex benefits and handling all special chars.

I tend to not support final player names with $ and other regex special chars. You should be able to resolve those errors by using entries in name-mappings.properties. Example entry in name-mappings.properties playername = playername1()Paranthese,playername2with$

evolutionsoftswiss commented 3 years ago

I had another look and the $ issue seems fixable without side effects. Here's the recent 0.2.1 version:

handhistory-converter-0.2.1-program.zip

I'll also check the parantheses name problem coming from another place, where it interferes with blind amounts search.

evolutionsoftswiss commented 3 years ago

@benstuart0 Did the version above let you import all hands, finally ? Then I would close the Issues and publish a new release.

Another remark, your try/catch without further actions could have been the source of the pot size problems, because one player was ignored...

benstuart0 commented 3 years ago

Exception in thread "main" java.lang.IllegalArgumentException: Illegal group reference: group index is missing at java.base/java.util.regex.Matcher.appendExpandedReplacement(Matcher.java:1030) at java.base/java.util.regex.Matcher.appendReplacement(Matcher.java:998) at java.base/java.util.regex.Matcher.replaceAll(Matcher.java:1182) at java.base/java.lang.String.replaceAll(String.java:2126) at ch.evolutionsoft.poker.pokernow.PokernowHandHistoryConverter.normalizePlayerNames(PokernowHandHistoryConverter.java:357) at ch.evolutionsoft.poker.pokernow.PokernowHandHistoryConverter.convertHandHistory(PokernowHandHistoryConverter.java:271) at ch.evolutionsoft.poker.pokernow.PokernowHandHistoryConverter.main(PokernowHandHistoryConverter.java:92) (base) Ben@Bens-Macbook handhistory-converter-0.2.1-program %

getting this error when running. This is the error that I put the try/catch in to stop, it hits on the Username containing a '$'.

evolutionsoftswiss commented 3 years ago

The updated version, with the same numbering 0.2.1 as before, in this thread should have this resolved I thought.

evolutionsoftswiss commented 3 years ago

I've just retested with a name containing several '$' and it worked. Here is the updated jar with new version to exclude you're testing on an older code base: In the zip, because i can't upload jars directly. handhistory-converter-0.2.2-program.zip

benstuart0 commented 3 years ago

0.2.2 does fix the $ errors! Other issue still remains. Some hands are getting import errors.

evolutionsoftswiss commented 3 years ago

Leave Issue open until published fixed version.

evolutionsoftswiss commented 3 years ago

Fixed in new Release v0.2.1.