Tag: words
Does the verbal component for spellcasting have to be words?
To make a long story short: for my first D&D campaign, I want to create a warlock that had to give up her voice as a part of her deal with her Patron.
As such, she is incapable of speaking, but she can still produce sounds with her mouth. I was wondering if that would incapacitate her from casting spells with a Verbal component.
Do spells needs a specific phrase to be cast, or does gibberish work?
Using subsets in a list to estimate total number of words
How do I estimate the total number of words in the English language that have exactly 3 letters? Buddy told me to count the number of subsets in a list, but I don’t know how that relates.
How to remove any words containing two adjacent characters with different cases?
I have a list of permutations of ABCabc
and I want to remove any permutations with two adjacent characters with different cases (uppercase and lowercase).
For example,
ABCcab
is kept.ABCacb
must be removed becauseCa
contains two adjacent characters with different cases.AbBcaC
must be removed as well.
Attempt
Here is my attempt but without filtering.
Select[StringJoin /@ Permutations[Characters@"ABCabc"],....]
Content generator : list of words or expressions that will allow you to exclude sources
Hello, Sven,
My suggestion
Create a list of words or expressions that will allow you to exclude sources that you do not want to retrieve.
Example: When doing marketing research, I find with sentences about marriage
How unsafe are words based on adjacent keys, like asdf, querty, etc
For passwords that are safe, but also memorable (since a forgetful user is also a risk), would ‘trails’ of keyboard keys be of any use? Like ‘asdf’ or ‘qwerty’, but maybe less common combinations, like ‘$ RFV’?
Would a two word domain name with a shared letter between the words be treated the same for SEO as the fuller name?
I found a domain name (2 words) that is not available. Then I found almost the same domain name with a slight difference, the last letter of the first word is the same of the first letter of the second word.
Ex : jamessecret.com (not available) jamesecret.com (available)
In terms of SEO, is it seen as the same to Google? Would search engines interpret them the same?
If we want to map abbreviations of fullEnglish words (e.g. map “Jan” to “January”), how can we identify abbreviations which map to multiple words?
Short Version:
How can we construct such a trie which maps abbreviations of namesofthemonth to fullmonth (we map the abbreviation "mar" to "march")?
 The set of all abbreviations is formed by:
 keeping the first letter of the month name. (all abbreviations of "
january
" begin with "j
") deleting 1 or more characters ("
jan
" deletes "uary
" from "january
")
The Looonnnnggg Version:
How can we construct such a trie?
What algorithm will build the appropriate trie from the container of verbose strings.
Consider the English names for months of the year:
 January
 February
 March
 April
 [… truncated …]
 October
 November
 December
We find it useful say that the English names for months of the year are "verbose" strings.
For any "verbose" string $ v$ , and any string $ a$ we say that $ a$ is an "abbreviation" of $ v$ if and only if all of the following conditions are met:
 $ a$ nonempty. $ a \geq 1$
 $ a$ can formed by deleting 1 or more characters from "verbose" string $ v$
 $ a(1) = v(1)$ . Assume that string indexing begins at $ 1$ , and not $ 0$ .
For example, "jan
" is an abbreviation of "january
."
Suppose you want to write an algorithm which:
 accepts a list of verbose strings as inputs.
 the algorithm outputs a "trie" datastructure (information retrieval tree) $ T$ such that:
 The trie $ T$ accepts any ASCII string as input.
 An output (leaf node) of the trie should be set of strings $ S$ such that:
 every string in $ S$ is a verbose string
 the string fed as input into trie $ T$ is an abbreviation of every verbose string in container $ S$
Some examples of input to the trie and output of the trie are shown below:

Example 1
 Input: "
Ma
"  Output: $ \{$ "
March
", "May
"$ \}$
 Input: "

Example 2
 Input: "
Mar
"  Output: $ \{$ "
March
"$ \}$
 Input: "

Example 3
 Input: "
Decuary
"  Output: $ \{$ "
 Input: "
The output from the trie should be one of:
 the empty set
 a set of one item
 a set of two or more items
For months of the year, we might write javascript so that an enduser can type in any halfway reasonable dateformat, instead getting an error message when they put slashes instead of dashes, etc….
If you do not like the months of the year application, a different usecase would be to write write your own Linux Shell (similar to BASH). Maybe any halfway reasonable abbreviation of "make directory
" will map to "mkdir
" In that case, we could have manytoone mapping from highlevel shellcommands to lowlevel Linux commands.
The question is:
How can we construct such a trie?
What algorithm will build the appropriate trie from the container of verbose strings.
Also, can we avoid bruteforce generating a list of all aberrations beforehand? The set of all strings formable by deleting 1 or more characters from the verbose strings is quite large. We would like to avoid combinatorial explosion, if we can.
The programming language (Java, python, C+ + ) does not matter for answering this question.
Number of words of length n for special language
Let $ \Sigma$ be an alphabet and let $ L$ be a language over it with the following properties:
 if $ w\in L$ then there exists $ v\in \Sigma^*$ such that $ wv \in L$ and for every $ s\in \Sigma$ the word $ wvs$ does not lie in $ L$
 $ wv\in L$ then $ vw \in L$
 It is prefixclosed, i.e. prefix of any word is still in the language.
Note that by the definition, it is not cyclic language. I’m trying to compute its growth function, by that I mean $ \gamma_n:= \{w\in L \mid w = n\}$ . I know about my specific case that it is not regular and my hypothesis is that function $ \Gamma(x) = \sum_{n=1}^\infty \gamma_nx^n$ is not rational. However, I couldn’t find any information about these functions for nonregular languages. Maybe, there’s a formula that connects entropy of language, i.e. $ e(L):= \limsup\limits_{n\to\infty} \frac{\log\gamma_n}{n}$ and the $ \Gamma$ function. Or for such a language there’s a way to describe its growth throughout the growth of the language $ \operatorname{End}(L) = \{ w\in L \mid \forall s\in \Sigma \,ws \text{ is not in } L \}$ .
Is my recursive algorithm for Equivalent Words correct?
Here is my problem.
Problem Given two words and a dictionary, find out whether the words are equivalent.
Input: The dictionary, D (a set of words), and two words v and w from the dictionary.
Output: A transformation of v into w by substitutions such that all intermediate words belong to D. If no transformation is possible, output “v and w are not equivalent.”
I need to write both recursive and dynamic programming algorithm. As for recursion, I came up with this algorithm. Is it correct?
EquivalentWordsProblem(v, w, D) 1.m < len (v) 2.n < len (w) 3.substitutions = [] #array to save substitutions 4.if m != n: 5. return "v and w are not equivalent" 6.else 7.for i < m to 1 <1 do 8. for j < n to j < 1 do 9. if v[i] != w[j]: 10. substituted_word < v[1…i1]+v[j] #we substitute v[i] for w[j] 11. if substituted_word in D: 12. substitutions.append(substituted_word) 13. return EquivalentWordsProblem(v[1…mi], w, D) #recur on the string of length m  i 14. else: return EquivalentWordsProblem(v[1…m1], w, D) #recur on the string decreasing its length by 1 15.if len(substitutions) != 0: 16. return substitutions 17.else 18. return (“v and w are not equivalent”)