Advertisement
Guest User

Untitled

a guest
May 28th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.42 KB | None | 0 0
  1. let task4 (words: string seq) : Text =
  2.     let wordsCount = words |> Seq.countBy id
  3.     let dict =  wordsCount
  4.                 |> Seq.filter (fun x -> (snd x) > 5)
  5.                 |> Seq.map (fst)
  6.                 |> Seq.toArray
  7.     let text =  words
  8.                 |> Seq.map (fun x -> try Id(Array.findIndex (fun y -> y = x) dict) with | :? System.Collections.Generic.KeyNotFoundException -> String(x))
  9.     (text, dict)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement