My Project
osl::record::KanjiMove Class Reference

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 KanjiMoveinstance ()

Private Types

typedef std::list< Movefound_moves_t
typedef std::unordered_map< std::string, Squarestr2position_t
typedef std::unordered_map< std::string, Ptypestr2piece_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

Detailed Description

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.

Member Typedef Documentation

◆ found_moves_t

typedef std::list<Move> osl::record::KanjiMove::found_moves_t
private

Definition at line 38 of file kanjiMove.h.

◆ str2piece_t

typedef std::unordered_map<std::string, Ptype> osl::record::KanjiMove::str2piece_t
private

Definition at line 46 of file kanjiMove.h.

◆ str2position_t

typedef std::unordered_map<std::string, Square> osl::record::KanjiMove::str2position_t
private

Definition at line 44 of file kanjiMove.h.

Constructor & Destructor Documentation

◆ KanjiMove()

◆ ~KanjiMove()

osl::record::KanjiMove::~KanjiMove ( )

Definition at line 254 of file kanjiMove.cc.

Member Function Documentation

◆ instance()

const osl::record::KanjiMove & osl::record::KanjiMove::instance ( )
static

Definition at line 492 of file kanjiMove.cc.

References KanjiMove().

◆ selectCandidates()

void osl::record::KanjiMove::selectCandidates ( found_moves_t & found,
std::string & str,
const Square & to_pos,
const Player & player ) const
private

◆ setVerbose()

void osl::record::KanjiMove::setVerbose ( bool verbose)
inline

Definition at line 31 of file kanjiMove.h.

References verbose.

Referenced by osl::ki2::Ki2File::Ki2File().

◆ strToMove()

const osl::Move osl::record::KanjiMove::strToMove ( const std::string & orig,
const NumEffectState & state,
const Move & last_move ) const

◆ toPtype()

osl::Ptype osl::record::KanjiMove::toPtype ( const std::string & s) const

◆ toSquare()

osl::Square osl::record::KanjiMove::toSquare ( const std::string & s) const

Definition at line 259 of file kanjiMove.cc.

References str2position.

Referenced by osl::kakinoki::strToMove(), and strToMove().

Member Data Documentation

◆ str2piece

Definition at line 47 of file kanjiMove.h.

Referenced by KanjiMove(), and toPtype().

◆ str2position

Definition at line 45 of file kanjiMove.h.

Referenced by KanjiMove(), and toSquare().

◆ verbose

Definition at line 48 of file kanjiMove.h.

Referenced by KanjiMove(), setVerbose(), and strToMove().


The documentation for this class was generated from the following files: