[mode] Mode format returns mode count, not the actual mode
#979 创建于 2025年11月15日
仓库指标
- 星标
- (52 个星标)
- PR 合并指标
- (PR 指标待抓取)
描述
It seems that the mode format returns how many times the mode appears, not the actual mode itself
https://github.com/SemanticMediaWiki/SemanticResultFormats/blob/42c26905f5d9f25a321a0c3b286d5b0d239a8083/formats/math/SRF_Math.php#L187
https://github.com/SemanticMediaWiki/SemanticResultFormats/blob/42c26905f5d9f25a321a0c3b286d5b0d239a8083/formats/math/SRF_Math.php#L189
https://github.com/SemanticMediaWiki/SemanticResultFormats/blob/42c26905f5d9f25a321a0c3b286d5b0d239a8083/formats/math/SRF_Math.php#L201
array_count_values gives counts as values, and max gets the max value, meaning $max is a count, not the most common property value
It seems the unit test even expects the count instead of the actual mode
The mode should be 333, the only number, but instead it expects and gets how many times 333 occurs