class Egd::PositionFeatureDiscerner
Attributes
end_fen[R]
Currently minimal function, Only looks at supplied move and tells whether the position is a check or checkmate.
move[R]
Currently minimal function, Only looks at supplied move and tells whether the position is a check or checkmate.
Public Class Methods
new(move:, end_fen:)
click to toggle source
# File lib/egd/position_feature_discerner.rb, line 11 def initialize(move:, end_fen:) @move = move @end_fen = end_fen end
Public Instance Methods
call()
click to toggle source
# File lib/egd/position_feature_discerner.rb, line 16 def call return @features if defined?(@features) @features = {} @features.merge!("check" => true, "checkmate" => true) if move[%r'#\z'] @features.merge!("check" => true) if move[%r'\+\z'] @features end