diff --git a/PgnParser.php b/PgnParser.php index 5674b25..a025004 100644 --- a/PgnParser.php +++ b/PgnParser.php @@ -27,8 +27,9 @@ class PgnParser $this->pgnContent = $content; } - public function cleanPgn($c) + private function cleanPgn() { + $c = $this->pgnContent; $c = preg_replace("/\\$[0-9]+/s", "", $c); $c = str_replace("({", "( {", $c); $c = preg_replace("/{([^\[]*?)\[([^}]?)}/s", '{$1-SB-$2}', $c); @@ -36,7 +37,7 @@ class PgnParser $c = preg_replace("/\t/s", "", $c); $c = preg_replace("/\]\s+\[/s", "]\n[", $c); $c = str_replace(" [", "[", $c); - $c = preg_replace("/([^\]])(\n+)\[([a-z])/si", "$1\n\n[$3", $c); + $c = preg_replace("/([^\]])(\n+)\[/si", "$1\n\n[", $c); $c = preg_replace("/\n{3,}/s", "\n\n", $c); $c = str_replace("-SB-", "[", $c); $c = str_replace("0-0-0", "O-O-O", $c); diff --git a/autoload.php b/autoload.php index 012ccd0..536fa8e 100644 --- a/autoload.php +++ b/autoload.php @@ -7,6 +7,7 @@ spl_autoload_register( static $classes = null; if ($classes === null) { $classes = array( + 'chess_json' => '/CHESS_JSON.php', 'board0x88config' => '/Board0x88Config.php', 'dgtgameparser' => '/DGTGameParser.php', 'fenparser0x88' => '/FenParser0x88.php',