USPTO / PatentPublicData

Utility tools to help download and parse patent data made available to the public
Other
180 stars 81 forks source link

fix java.lang.StringIndexOutOfBoundsException when chinese company name starts with parentheses #126

Open thomaskelder opened 2 years ago

thomaskelder commented 2 years ago

Fixes https://github.com/USPTO/PatentPublicData/issues/125.

This was caused by a chinese company name of the form:

(SHENZHEN) COMPANY, LIMITED

The method that tries to parse out the company name before the city part in parentheses fails, because it is at the beginning of the string (the actual company name seems missing).

Fixed it by skipping the company name parsing if this is the case and included a unit test for this.