[h=1]How to define the possible combinations of factorials if we take the words in a sentence with a position number as a factorial?[/h]
In NLP context, I am researching an efficient way to define positions of all combinations of words in a sentence.In math I thought similar permutation methos is called: factorial= n! .
Whereby N is the elements to choose from, k the elements which could be chosen (1-N), order is not important, repetition is not allowed.
Imagine a sentence with 2 words:
I want.Splitting this sentence results in 2 word, where the positions are I=1, want=2.
As the formula specifies, the result is 2!=2 combinations (2^1= 2). The positions of these combinations are then 1.2 , 2.1.
Now I want to make a function/formula which gives me all the combinations with their position number as a list for any length. Probably this is a known math function and already as a function in the Java space.
Is there anyone who can help me with finding the formula or the function in Java, NLP which I can use in this context?
In NLP context, I am researching an efficient way to define positions of all combinations of words in a sentence.In math I thought similar permutation methos is called: factorial= n! .
Whereby N is the elements to choose from, k the elements which could be chosen (1-N), order is not important, repetition is not allowed.
Imagine a sentence with 2 words:
I want.Splitting this sentence results in 2 word, where the positions are I=1, want=2.
As the formula specifies, the result is 2!=2 combinations (2^1= 2). The positions of these combinations are then 1.2 , 2.1.
Now I want to make a function/formula which gives me all the combinations with their position number as a list for any length. Probably this is a known math function and already as a function in the Java space.
Is there anyone who can help me with finding the formula or the function in Java, NLP which I can use in this context?