Saburo Higuchi

Dr. Saburo Higuchi

5 Reputation

0 Badges

8 years, 230 days
http://hig3.net

MaplePrimes Activity


These are questions asked by Saburo Higuchi

Dear All,

I use Maple T.A. 10. I try to use StringTools[Search] in algorithm variables but have not succeeded. Any help would be appreciated.

Algorithm Variable definitions

$pattern1=maple('"sin(1/2*Pi)"');
$text1=maple('"sin(1/2*Pi)"');
$test1=maple("StringTools[Search]($pattern1,$text1)");
$test2=maple('StringTools[Search]($pattern1,$text1)');

give us the following result, whereas I expect the return value 1.

pattern1 "sin(1/2*Pi)"
text1 "sin(1/2*Pi)"
test1 com.maplesoft.server.router.MapleSyntaxException: on line 116, syntax error, `,` unexpected:
test2 module () local Testing, Bitmap, BF, SuffixArray, LyndonFactorPositions, CheckMaximalRepeat, slowLyndonFactors, SerialCorrelationCoefficient, ChiSquared, LongestCommonSubSequenceLength, PrintSentences, `difficult?`, matchMatrix2, _randperm, _permute, _config, trampoline, Sequitur, passign, defun, compressImpl, uncompressImpl; export Length, IsUpper, IsLower, IsAlpha, IsDigit, IsAlphaNumeric, IsControlCharacter, IsSpace, IsPunctuation, IsGraphic, IsIdentifier, IsIdentifier1, IsPrintable, IsASCII, IsHexDigit, IsOctalDigit, IsBinaryDigit, IsVowel, HasUpper, HasLower, HasAlpha, HasDigit, HasAlphaNumeric, HasControlCharacter, HasSpace, HasPunctuation, HasGraphic, HasIdentifier, HasIdentifier1, HasPrintable, HasASCII, HasHexDigit, HasOctalDigit, HasBinaryDigit, HasVowel, Has, ExpandCharacterClass, Random, Randomize, IndexOfCoincidence, Entropy, ArithmeticMean, Kasiski, Repeats, Explode, Implode, Chop, Chomp, Fence, MatchFence, PadLeft, PadRight, Centre, Center, Trim, TrimRight, TrimLeft, Squeeze, DeleteSpace, Reverse, Insert, Delete, IsPrefix, IsSuffix, CommonPrefix, CommonSuffix, LongestCommonSubString, LongestCommonSubSequence, Soundex, Metaphone, Levenshtein, HammingDistance, EditDistance, PrefixDistance, SuffixDistance, DifferencePositions, Compare, CompareCI, CamelCase, UpperCase, LowerCase, OtherCase, Capitalize, FirstFromLeft, FirstFromRight, Take, Drop, Snarf, CharacterMap, LeftFold, RightFold, Map, AndMap, OrMap, Char, Ord, SubString, Select, Remove, SelectRemove, Group, Split, CaseSplit, LengthSplit, StringSplit, Readability, Sentences, Words, WordStart, WordEnd, WordContaining, NGrams, SimilarityCoefficient, WordCount, Join, CaseJoin, RegMatch, RegSub, RegSubs, RegSplit, ApproximateSearch, ApproximateSearchAll, HammingSearch, HammingSearchAll, Search, SearchAll, Substitute, SubstituteAll, PatternDictionary, FormatMessage, FormatTime, ParseTime, Fill, Repeat, Iota, Visible, Escape, Encode, Decode, Compress, Uncompress, WildcardMatch, NumbOccur, CountCharacterOccurrences, Shift, Rotate, Exchange, Stem, Permute, SortPermutation, Sort, Unique, Hash, IsSorted, IsAnagram, Anagrams, SyllableLength, Generate, NthWord, Support, IsBalanced, IsSubSequence, IsPalindrome, IsEodermdrome, IsPermutation, IsDerangement, IsMonotonic, IsPrimitive, PrimitiveRoot, Border, BorderLength, BorderArray, Overlap, IsConjugate, MinimumConjugate, Period, IsPeriod, Fibonacci, ThueMorse, MonotonicFactors, LyndonFactors, LexOrder, ShortLexOrder, RevLexOrder, ShortRevLexOrder, LeftRecursivePathOrder, RightRecursivePathOrder, ToByteArray, FromByteArray, CharacterFrequencies, MaximalPalindromicSubstring, MinChar, MaxChar, Tabulate, StringBuffer, ExpandTabs, WrapText, Indent, PatternEquivalent, PatternCanonicalForm, GenerateIdentifier, _pexports; options package, noimplicit, `Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2005`; description "a package of string manipulation utilities"; end module(Search)("sin(1/2*Pi)","sin(1/2*Pi)")
   

I confirmed that one can use StringTools[Search] in the question source code as explained in http://www.maplesoft.com/support/help/MapleTA10/MapleTAInstructor/ch06s04.aspx#Chapter06_UsingMapleCodetoPreventCheatinginMapleSyntaxQuestions

maple=evalb(0=StringTools[Search]("factor","$RESPONSE")) and evalb($RESPONSE=factor(x^2-1))

I note that searchtext or SearchText procedures could be used instead in algorithm variables.

Page 1 of 1