Documentation
¶
Index ¶
- Constants
- func ConvertMap(invertedLayout map[string]int) (map[int]rune, error)
- func DoTick() tea.Cmd
- func FillTerminal(strList []string, height int) string
- func SuffixedNumber(number float64) string
- func TableStrings(tableList []StatsRow) [][]string
- func Ticker(p *tea.Program, finish chan bool)
- type BaseMessage
- type BestLayout
- type BigramList
- type ByeMessage
- type Finished
- type HelloMessage
- type KeyPos
- type KeyScores
- type LayoutGrid
- type LetterData
- type LetterMessage
- type Quitting
- type StatsMessage
- type StatsRow
- type StatsTables
- type SubResult
- type SubTask
- type Task
- type TaskMessage
- type Tick
- type TickMsg
Constants ¶
View Source
const ActiveTasksFactor = 2
View Source
const AvgTimeFactor = 5
View Source
const ByeMsg = 9
View Source
const DataMsg = 1
View Source
const FinalByeMsg = 10
View Source
const HelloMsg = 1
View Source
const RescindMsg = 4
View Source
const ResultMsg = 3
View Source
const ShutdownMsg = 8
View Source
const StatsMsg = 6
View Source
const TaskMsg = 2
View Source
const ThreadMsg = 5
Variables ¶
This section is empty.
Functions ¶
func FillTerminal ¶
func SuffixedNumber ¶
func TableStrings ¶
Types ¶
type BaseMessage ¶
type BestLayout ¶
type BigramList ¶
type BigramList struct {
Bigrams map[string]float64 `json:"bigrams"`
Letters map[string]float64 `json:"letters"`
}
func ParseBigramsFile ¶
func ParseBigramsFile(path string) (BigramList, error)
func (*BigramList) Print ¶
func (bl *BigramList) Print()
type ByeMessage ¶
type HelloMessage ¶
type LayoutGrid ¶
func ParseGridFile ¶
func ParseGridFile(path string) (LayoutGrid, error)
type LetterData ¶
type LetterData struct {
Bigrams map[string]float64
Scores KeyScores
Allowed map[int]string
Letters string
Keys []int
}
func CreateLetterData ¶
func CreateLetterData( bigrams BigramList, scores KeyScores, upperLimit int, lowerLimit int) LetterData
type LetterMessage ¶
type LetterMessage struct {
MessageID string
MessageType int
Allowed map[int]string // which letters are allowed in which key position
Bigrams map[string]float64 // occurrence of a bigram per 1M words
Scores map[int]map[int]float64 // score of a key combination
Letters string // order of most common letter
Keys []int // order of most valuable position
Grid LayoutGrid // physical layout grid
}
type StatsMessage ¶
type StatsMessage struct {
MessageID string
MessageType int
Stats StatsTables
}
type StatsRow ¶
func SortTables ¶
func (StatsRow) CompString ¶
func (StatsRow) CoresString ¶
func (StatsRow) GPUsString ¶
func (StatsRow) OutputStrings ¶
func (StatsRow) RateString ¶
type StatsTables ¶
func (StatsTables) OverallStrings ¶
func (st StatsTables) OverallStrings() [][]string
func (StatsTables) SessionStrings ¶
func (st StatsTables) SessionStrings() [][]string
type SubResult ¶
type SubResult struct {
SubID int
Computations int
TimeElapsed int64
Layout map[rune]int
Score float64
// contains filtered or unexported fields
}
func (*SubResult) GetChunkSize ¶
func (*SubResult) ReverseMap ¶
type SubTask ¶
type SubTask struct {
SubID int
Chunk map[int]rune
Computations int
TimeElapsed int64
Layout map[rune]int
Score float64
}
func (SubTask) GetChunkSize ¶
func (*SubTask) RecordDuration ¶
func (*SubTask) SaveLayout ¶
type Task ¶
type Task struct {
TaskID int
SubTasks []SubTask
BeginTime int64
EndTime int64
// contains filtered or unexported fields
}
func (Task) Computations ¶
func (*Task) RecordStart ¶
func (Task) TimeElapsed ¶
type TaskMessage ¶
Click to show internal directories.
Click to hide internal directories.