Мелкие улучшения по коду
This commit is contained in:
@@ -21,7 +21,7 @@ main =
|
||||
saveDictionary "dict2.txt" dict2 >>
|
||||
putStrLn "Введите начальное слово или пару слов для старта диалога:" >>
|
||||
getLine >>= \input2 ->
|
||||
putStrLn "Введите количество сообщений M:" >>
|
||||
putStrLn "Введите количество сообщений от каждой модели:" >>
|
||||
getLine >>= \ms ->
|
||||
let m = read ms :: Int in
|
||||
twoModelsDialog dict dict2 input2 m
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
module Lib where
|
||||
module Lib (
|
||||
splitText,
|
||||
buildDictionary,
|
||||
saveDictionary,
|
||||
processInput,
|
||||
twoModelsDialog
|
||||
) where
|
||||
|
||||
import Data.Char (isLetter, toLower)
|
||||
import Data.Map (Map)
|
||||
@@ -94,7 +100,8 @@ twoModelsDialog dict1 dict2 start m =
|
||||
in putStrLn ("Модель 1: (" ++ start ++ ") " ++ unwords first) >>
|
||||
loop dict1 dict2 first m
|
||||
where
|
||||
loop d1 d2 prev 0 = return ()
|
||||
loop :: Map String [String] -> Map String [String] -> [String] -> Int -> IO ()
|
||||
loop _ _ _ 0 = return ()
|
||||
loop d1 d2 prev i =
|
||||
putStr "Модель 2: " >>
|
||||
dialogStep d2 prev >>= \resp ->
|
||||
|
||||
Reference in New Issue
Block a user