Words containing "the" substring: Difference between revisions

m
→‎{{header|AppleScript}}: Minor comment edits.
m (→‎{{header|AppleScript}}: Minor preamble edit.)
m (→‎{{header|AppleScript}}: Minor comment edits.)
Line 129:
<lang applescript>on wordsContaining(textFile, searchText, minLength)
-- Set up and execute a shell script which uses grep to find words containing the search text
-- (matching theAppleScript's current AppleScript case-sensitivity setting) and awk to pass those which
-- satisfy the minumumminimum length requirement.
if ("A" = "a") then
set part1 to "grep -io "
Line 157:
set theWords to theText's componentsSeparatedByString:(linefeed)
-- Filter the resulting array for strings which meet the search text and minimum length requirements,
-- matching theAppleScript's current AppleScript case-sensitivity setting. NSString lengths are measured in 16-bit
-- code units so use regex to check the lengths in characters.
if ("A" = "a") then
557

edits