[ngrams] code fixes according to review

Related MR:
!378
parent bf89561b
Pipeline #7287 failed with stages
in 45 minutes and 56 seconds