Updated code

This commit is contained in:
DHTMLGoodies
2013-06-21 09:39:37 +02:00
parent 27dbd1d13d
commit eb1af65948
2 changed files with 4 additions and 2 deletions

View File

@@ -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);

View File

@@ -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',