Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I was surprised to see that Interpreter requires external WR resources as this is not documented, at least not here.

On a 3Ghz iMac, took ~half a minute to process n=68 time strings:

timeData = {"0:12:15", "0:13:00", "0:17:00", "0:00:39", "0:00:25", "0:00:38", 
"0:00:48", "0:05:50", "0:03:34", "0:05:50", "0:00:22", "0:04:05", 
"0:00:07", "0:00:07", "0:00:46", "0:00:02", "0:00:32", "0:00:11", 
"0:00:31", "0:09:55", "0:00:07", "0:00:34", "0:00:36", "0:07:44", 
"0:00:11", "0:00:20", "0:02:29", "0:04:30", "0:00:56", "0:01:23", 
"0:00:05", "0:00:05", "0:00:18", "0:00:13", "0:00:21", "0:00:21", 
"0:00:06", "0:00:13", "0:00:56", "0:00:05", "0:00:15", "0:00:05", 
"0:01:38", "0:00:22", "0:01:43", "0:00:14", "0:09:06", "0:01:39", 
"0:03:17", "0:03:08", "0:00:45", "0:00:36", "0:00:38", "0:00:06", 
"0:00:08", "0:01:07", "0:00:08", "0:01:06", "0:00:11", "0:00:17", 
"0:00:08", "0:00:17", "0:00:09", "0:00:34", "0:00:25", "0:00:31", 
"0:00:07", "0:01:29"};

AbsoluteTiming [Interpreter["Time"][#] & /@ timeData ] // First

26.633811

Timing is much lower, ~3 seconds, though once I ran it and got:

"Interpreter::timeout : "A network operation for Interpreter timed out. Please try again later."

Users can define their own interpreters, but curious if it's possible to make at least part of the functionality available locally? I can't imagine a simpler test case than time strings.

share|improve this question
1  
I posted on a similar issue in the Wolfram Community. –  Sjoerd C. de Vries Jul 16 at 21:36
    
Thanks for the link Sjoerd. –  alancalvitti Jul 16 at 21:38

1 Answer 1

Two solutions:

  1. Use the listability of Interpreter to parallelize calls to WR servers:

     In[1]:= AbsoluteTiming[Interpreter["Time"][timeData]] // First  
     Out[1]= 6.551647
    
  2. Use Structured interpreters to avoid calling WR servers altogether:

    In[2]:= AbsoluteTiming[Interpreter["StructuredTime"][timeData]] // First  
    Out[2]= 0.165715
    

In general you might want to refer to this guide, and to pages that describe the single types.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.