And, of course you can continue to use .contains: (every? #(.contains value %) ["CBS" "Bar" "cat"])
On Sat, Jun 22, 2019 at 10:37 AM Andy Fingerhut <andy.finger...@gmail.com> wrote: > I haven't counted characters, but this would certainly become relatively > shorter the more substrings you check for. It is shown in the context of a > Clojure REPL. I do not know whether OpenRefine might already do the > require for you, or perhaps even (use 'clojure.string). > > user=> (def value "Bar the cat from CBS") > #'user/value > user=> (require '[clojure.string :as str]) > nil > user=> (every? #(str/includes? value %) ["CBS" "Bar" "cat"]) > true > > Andy > > > On Sat, Jun 22, 2019 at 10:32 AM Thad Guidry <thadgui...@gmail.com> wrote: > >> Clojure is supported as an expression language in OpenRefine. Where any >> cells value in OpenRefine's datagrid is just accessed by the name value. >> Here's one of my cells value in OpenRefine... >> >> "001","878","245","$c","CBS Barmarick Publications,","$c","Emerald" >> >> and I am trying to see if that cells value contains all of these words... >> >> (and (.contains value "CBS") (.contains value "Bar") (.contains value >> "cat")) >> >> It works, but I am looking to Clojure experts to find out how to shorten >> this expression? >> >> -Thad >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clojure@googlegroups.com >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> clojure+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en >> --- >> You received this message because you are subscribed to the Google Groups >> "Clojure" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to clojure+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/clojure/c37eb1b0-1557-486b-b95a-a5bc53b67b24%40googlegroups.com >> <https://groups.google.com/d/msgid/clojure/c37eb1b0-1557-486b-b95a-a5bc53b67b24%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAKvLtDZxWM49qu-CCt-Lzn%3DCiQq%3DQy9MeY0kWV0tP4eHJknVbA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.