3

I'm an active user on the English Language & Usage stack, where questions of how idiomatic or common a particular usage is are asked with some frequency (for example, today we were asked Is it common to use “perverted” as an adjective?).

I would like to be able to answer these questions with evidence from the COCA Corpus, a powerful and popular tool in the community. The problem is, I can't figure out how to link to a particular set of results from the COCA; when using the app, all the URLs which appear in the address bar, regardless of where one is in the process, are just http://corpus.byu.edu/coca/, which simply lead back to the generic landing page.

Ideally, what I'd like is I'd like to provide a link so the OP could see a page like this, with all 3 panels:

COCA corpus screenshot, marked up

But I'd settle for being able to link to just one of the panels; for preference, the main panel, outlined in yellow in the bottom-right, which lists all the examples of perverted used as an adjective, but I'd also accept the panel giving measurements of relative usage, outlined in orange in the top-right.

I tried reverse-engineering this myself, but I'm stymied by the site's use of iFrames. I was able to sniff the HTTP traffic and get the appropriate query string to, theoretically, produce the content of either the examples panel:

http://corpus.byu.edu/coca/x3.asp?xx=1&w11=perverted.[j*]&r=

or, again theoretically, the content of the usage metrics panel:

http://corpus.byu.edu/coca/x2.asp?chooser=seq&p=perverted.%5Bj%5D&w2=&wl=4&wr=4&r1=&r2=&ipos1=-select-&B7=SEARCH&sec1=0&sec2=0&sortBy=freq&sortByDo2=freq&minfreq1=freq&freq1=10&freq2=10&numhits=100&kh=100&groupBy=words&whatshow=raw&saveList=no&changed=&corpus=coca&word=&sbs=&sbs1=&sbsreg1=&sbsr=&sbsgroup=&redidID=&ownsearch=y&compared=&holder=&whatdo=seq&waited=n&rand1=y&whatdo1=1&didRandom=n&minFreq=freq&s1=0&s2=0&s3=0&perc=mi

But plugging these URLs directly into a browser tab simply produces an error. I'm guessing the webapp is sensitive to referrer URLs or session cookies or something.

Can anyone tell me how I can create a link which would take visitors directly to the results of a particular COCA query?

  • It seems like they're actively working to prevent exactly what you're looking to do. User the URL with params redirects to a "blank" page, probably by checking the HTTP referrer. This is an effective measure against screen-scrapers, but as you've discovered, it makes it impossible for normal humans to share. – ale Jul 1 '15 at 23:26
  • @AlE. Yes, thanks, that's what I suspected. I'm googling around for an online service which lets you input a URL and a spoofed referer string, and generates a link which will redirect to that page with that referer, but all I'm finding is services which blank out the referer, the exact opposite of what we want in this case. I'm hesitant to stand up and maintain my own public service for this localized purpose. Seems like too much work. (And it is driving me nuts to keep having to spell referrer incorrectly!) – Dan Bron Jul 2 '15 at 10:14
3

Following a tip from the user @RegDwigнt on Meta.EL&U, it turns out COCA does have officially-supported mechanism to share links to specific results, but it requires that you register an account (accounts are free).

Steps:

  1. Register a COCA account
  2. Follow the instructions in the registration email (which may involve entering a 9-letter code)
  3. Log in to the corpus
  4. Perform your query
  5. Follow the history link which appears under your username in the top-right corner of the site

    screenshot of COCA app with history link indicated

  6. Find the query in your history (since it's the most recent, it should be at the top), and copy the URL from the share link link (not the re-run query link, which only works when logged in under your account).

The link now on your clipboard will take anyone who visits it to the specific query you selected from your history. For example, here's a link to the query I was interested in this morning: perverted used as an adjective.

If you follow that link, you should see something very similar to the original screenshot in the question. With one caveat: in certain browsers, the link will open a page with just the left-hand query panel displayed, and may attempt to launch a pop-up to display the actual results (specifically, the metrics panel outlined in orange in the top-right in the screenshot in the original question).

Since most browsers and ad-blockers disable pop-ups by default, this can cause confusion; visitors to your link may only see the search panel and not even be aware the content panel is trying to load in a pop-up. It may be best practice to warn them at the time you provide the COCA link.

If anyone has suggestions/a workaround for this issue, let me know in the comments, and I'll update this answer (or add your own answer, of course).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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