My Project
|
Parse kanji records such as "7六歩", the style of which is generally used to write Shogi records in Japanese. More...
#include <kanjiMove.h>
Public Member Functions | |
KanjiMove () | |
~KanjiMove () | |
const Move | strToMove (const std::string &, const NumEffectState &state, const Move &last_move) const |
Convert a Japanese string (one token) to a move object. | |
void | setVerbose (bool verbose) |
Square | toSquare (const std::string &) const |
Ptype | toPtype (const std::string &) const |
Static Public Member Functions | |
static const KanjiMove & | instance () |
Private Types | |
typedef std::list< Move > | found_moves_t |
typedef std::unordered_map< std::string, Square > | str2position_t |
typedef std::unordered_map< std::string, Ptype > | str2piece_t |
Private Member Functions | |
void | selectCandidates (found_moves_t &found, std::string &str, const Square &to_pos, const Player &player) const |
Private Attributes | |
str2position_t | str2position |
str2piece_t | str2piece |
bool | verbose |
Parse kanji records such as "7六歩", the style of which is generally used to write Shogi records in Japanese.
Definition at line 19 of file kanjiMove.h.
|
private |
Definition at line 38 of file kanjiMove.h.
|
private |
Definition at line 46 of file kanjiMove.h.
|
private |
Definition at line 44 of file kanjiMove.h.
osl::record::KanjiMove::KanjiMove | ( | ) |
Definition at line 218 of file kanjiMove.cc.
References osl::BISHOP, osl::record::StandardCharacters::dan, osl::GOLD, K_BISHOP, K_GOLD, K_KING, K_KING2, K_KNIGHT, K_LANCE, K_PAWN, K_PBISHOP, K_PKNIGHT, K_PKNIGHT_D, K_PLANCE, K_PLANCE_D, K_PPAWN, K_PROOK, K_PROOK2, K_PSILVER, K_PSILVER_D, K_ROOK, K_SILVER, osl::KING, osl::KNIGHT, osl::LANCE, osl::PAWN, osl::PBISHOP, osl::PKNIGHT, osl::PLANCE, osl::PPAWN, osl::PROOK, osl::PSILVER, osl::ROOK, osl::SILVER, str2piece, str2position, and osl::record::StandardCharacters::suji.
osl::record::KanjiMove::~KanjiMove | ( | ) |
Definition at line 254 of file kanjiMove.cc.
|
static |
Definition at line 492 of file kanjiMove.cc.
|
private |
Definition at line 277 of file kanjiMove.cc.
References osl::BLACK, osl::misc::eucToLang(), K_HIDARI, K_HIKU, K_MIGI, K_SHITA, K_SUGU, K_UE, K_YORU, K_YUKU, osl::WHITE, osl::Square::x(), and osl::Square::y().
|
inline |
Definition at line 31 of file kanjiMove.h.
References verbose.
Referenced by osl::ki2::Ki2File::Ki2File().
const osl::Move osl::record::KanjiMove::strToMove | ( | const std::string & | orig, |
const NumEffectState & | state, | ||
const Move & | last_move | ||
) | const |
Convert a Japanese string (one token) to a move object.
eliminate duplicate moves
Definition at line 360 of file kanjiMove.cc.
References osl::BLACK, osl::NumEffectState::generateWithFullUnpromotions(), osl::Move::INVALID(), osl::Move::isDrop(), osl::Move::isPromotion(), K_BLACK_SIGN, K_FUNARI, K_NARU, K_ONAZI, K_RESIGN, K_SPACE, K_UTSU, osl::Move::oldPtype(), osl::Move::to(), osl::SimpleState::turn(), and osl::WHITE.
Referenced by osl::ki2::Ki2File::parseLine().
osl::Ptype osl::record::KanjiMove::toPtype | ( | const std::string & | s | ) | const |
Definition at line 268 of file kanjiMove.cc.
Referenced by osl::kakinoki::KakinokiFile::parseLine(), osl::kakinoki::strToMove(), and osl::kakinoki::strToPiece().
osl::Square osl::record::KanjiMove::toSquare | ( | const std::string & | s | ) | const |
Definition at line 259 of file kanjiMove.cc.
Referenced by osl::kakinoki::strToMove().
|
private |
Definition at line 47 of file kanjiMove.h.
Referenced by KanjiMove().
|
private |
Definition at line 45 of file kanjiMove.h.
Referenced by KanjiMove().
|
private |
Definition at line 48 of file kanjiMove.h.
Referenced by setVerbose().