Naming Conventions |
|||||
|
Scalar |
Vector |
Matrix |
Any |
Non- |
Boolean |
BS |
BV |
BM |
BA |
BN |
Integer |
IS |
IV |
IM |
IA |
IN |
Float |
FS |
FV |
FM |
FA |
FN |
Numeric |
NS |
NV |
NM |
NA |
NN |
Character |
CS |
CV |
CM |
CA |
CN |
Enclosed |
ES |
EV |
EM |
EA |
EN |
enclosed |
TS |
TV |
TM |
TA |
TN |
Simple |
SS |
SV |
SM |
SA |
SN |
Any |
AS |
AV |
AM |
AA |
AN |
phrase e.g.: .X...Y. ⍝ X←BS; Y←IV |
|||||
combinations: use ISV for Integer scalar∨vector |
|||||
B3, I4 &c. to specify higher ranks. |
|||||
PhraseBook/FindInMatrix
This is phrase is searching a pattern in a matrix an return pairs of (row, column) in a vector for every hit.
↓⍉(⍴AM)⊤v/⍳⍴v←AV⍷,M
Examples
⎕FX ⍕2 1⍴'r←AM FindInMatrix AV;b' ' r←↓⍉(⍴AM)⊤v/⍳⍴v←AV⍷,M'
M←''
M,←⊂'January'
M,←⊂'February'
M,←⊂'March'
M,←⊂'April'
M,←⊂'May'
M,←⊂'June'
M,←⊂'July'
M,←⊂'August'
M,←⊂'September'
M,←⊂'October'
M,←⊂'November'
M,←⊂'December'
M←⊃M
M FindInMatrix 'em'
(8 4) (10 3) (11 3)
M FindInMatrix'nuar'
0 2
Compatibility
Checked with:
Test Cases
Show test cases
Test my code, both Examples and Test Cases.
See also: ...
Mentor: KaiJaeger
Tags:
APL Wiki
This page makes MildServer crash due to the ⊤ character part of the phrase. The page is therefore currently not part of the PhraeBook project until either MildServer's bug is fixed or MildServer is removed from the APL Wiki altogether.