Generating words in given format
Alright,
I managed to solve this problem using Prolog.

First of all, I've converted wordlist.txt from:


word1
word2
...


Into wordlist.pl:


w(w,o,r,d,1).
w(w,o,r,d,2).


Then I've found Prolog function, that tells me if all the elements in the list are different:

alldif([]).
alldif([E|Es]) :-
   maplist(dif(E), Es),
   alldif(Es).


After that I have written Prolog function, that takes predefined format and finds all the possible words from dictionary, that meet given format:

g(Format, String):-
    list_to_set(Format, Uniques),
    alldif(Uniques),
    w(Format),
    atomic_list_concat(Format, '', Atom), atom_string(Atom, String).


Now I'm able to call:

g([A,B,C], String1), g([A,D,A], String2).


That generates me all possible combinations of String1 and string2 with following format: 

"ABC ADA"