Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- `g` is a 'helper' `Dfn` (**D**efined **f**unctio**n**). It takes the length of the (right) argument and mixes the vector `aeiou` to itself that many times, yielding every possible combination of `[2, length(right arg)]` vowels.
- `{⊃,/⌽(,\⌽)¨,\⌽⍵}` is another 'helper' `Dfn`. It takes the right argument and yields every substring in order.
- (Thanks to @Adám for providing the correct form of the above functions)
- Finally, we have:
- {((⊆g⍵)∊{⊃,/⌽(,\⌽)¨,\⌽⍵}⍵)⊆g⍵} ⍝ Main function; argument ⍵ = 'abeoic'
- {((⊆g⍵) ) } ⍝ Monadic ⊆ encloses the results of g⍵ so they're interpreted as vectors instead of scalars.
- ∊ ⍝ Dyadic ∊ returns 1 for every index of the left argument that is in the right argument, and 0 otherwise.
- {⊃,/⌽(,\⌽)¨,\⌽⍵}⍵ ⍝ yields every substring of 'abeoic', in order.
- ⊆g⍵ ⍝ Dyadic ⊆ partitions the results of it's right argument g⍵ according to a boolean (in APL, 1 for true and 0 for false) vector, which is what the dyadic ∊ returns.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement