假設我有一些文本(代碼):給出一段文本,一些keyshorts和目標文本,如何獲得最小按鍵來轉換文本?
def text = ParamMenuable.this.linkText
def locPath: List[LocPath] = ParamMenuable.this.path
def parser = ParamMenuable.this.parser
def listToFrom(in: List[String]): Box[String] = in.headOption
和一些keyshorts:
arrow-left/right/up/down: move cursor to left/right/up/down for one char
ctrl + d: duplicate current line
ctrl + arrow-left/right/up/down: move cursor to left/right/up/down for one word
ctrl + y: delete current line
... all kinds of key shorts you usually used
與譯文是:
def text() = {
ParamMenuable.this.linkText
}
def locPath: List[LocPath] = ParamMenuable.this.path
def locPath22222: List[LocPath] = ParamMenuable.this.path
private def parser = {
return ParamMenuable.this.parser;
}
我的問題是:有多少關鍵短褲你應該至少按下將源文本轉換爲目標文件?你可以選擇合適的關鍵短褲來做得更好。
滑稽,它是某種[漢明距離]的擴展延長(http://en.wikipedia.org/wiki/Hamming_distance)與由熱鍵可到達的宏。這將取決於通過熱鍵可達到的轉換。然後,你必須嘗試列出它們(複製/粘貼是一個他們,但其他人?)。 – perror
聽起來像是一個搜索問題。我會執行一個A * - 搜索來找到一個最佳的解決方案。 – MrSmith42
我什麼也沒試,因爲我現在不知道做什麼:( – Freewind