Understanding the difference between search matchType: 'headword' vs 'inflection'

shahoodshahood Member ✭✭
edited September 2018 in General

Hi @AmosDuveen,

Here is the scenario: For example, I'm looking up "zebra crossing" using search endpoint.

I start with the search term "zebra cross". At 7th search suggestion, i get the following:

  "id": "zebra_crossing",
  "matchString": "zebra cross",
  "region": "gb",
  "score": 0.55143934,
  "word": "zebra crossing",
  "matchType": "headword"

Then I try the search term "zebra crossing". Here is what I get as the 1st suggestion:

  "score": 12.682389,
  "word": "zebra_crossing",
  "region": "gb",
  "inflection_id": "zebra crossing",
  "matchString": "zebra crossing",
  "id": "zebra_crossing",
  "matchType": "inflection"

I can notice the difference in matchType in both cases but I also notice the difference between 'word' field which is something I can't quite comprehend.

  1. Looking at id, one can conclude that it is the same dictionary entry. Is that right? If yes, why is word field different in both cases? If no, why does id field contain the same
    value in both cases?

  2. Is word field dependent on matchType? If yes, how?

  3. What is inflection_id in second case? Why has it not been defined in the Model and being an id, why doesn't it contain the hyphenated version?

  4. I went an extra mile looking up "zebra crossing" in inflections endpoint. There I got an array "inflectionOf" with one entry in it having "id": "zebra_crossing". Shouldn't this "id": "zebra_crossing" correspond to the inflection_id as mentioned in Q3 above? If yes, why is this one hyphenated and the one in Q3 not hyphenated?

Hope to hear from you soon!



  • AmosDuveenAmosDuveen Member, Administrator, Moderator admin

    Hi @shahood,

    I will need to make enquiries about this one...

  • shahoodshahood Member ✭✭
    @AmosDuveen hi, pl inform if there's any progress.
  • AmosDuveenAmosDuveen Member, Administrator, Moderator admin

    Hi @shahood,

    Apologies for the delay. Our team have logged it as a bug but fixing it will depend on some other stuff that is happening behind the scenes.

  • shahoodshahood Member ✭✭

    @AmosDuveen Ok, for now, I've amended my code to cater for such a scenario. Not an ideal solution but that's the only solution atm.
    I think I've another question somewhat relevant to this scenario which I'll post as a new question soon.

  • shahoodshahood Member ✭✭

    @AmosDuveen Oh and until it gets fixed, can u at least let us all know what is wrong in above two results and what should have been the correct values?
    Like the title says, I'm trying to understand the difference, if any, related to the matchTypes involved.

  • AmosDuveenAmosDuveen Member, Administrator, Moderator admin

    Hi @shahood,

    The first example looks OK to me: you searched "zebra cross" and found "zebra crossing" as a headword.

    The second example looks odd in a couple of ways: [1] you noticed that it wasn't an inflected form; [2] the word value should not contain an underscore (only id should contain underscores).

  • shahoodshahood Member ✭✭
    @AmosDuveen ok we are pretty much on the same page then. Thanks.
  • shahoodshahood Member ✭✭
    edited October 2018

    Hi @AmosDuveen

    Although this question ain't about either of headWord or inflection matchType but about variantForm, I still thought we could use the context of this post.

    So, for example, when we search for 'earth tremor', the first result is as follows:

      "matchString": "earth tremor",
      "matchType": "variantForm",
      "word": "earth tremor",
      "region": "gb",
      "matchForm": "tremor",
      "id": "tremor",
      "score": 8.016775

    What I can't understand is why "word" field contains the value of search query instead of the word that is actually returned, which in this case is "tremor"?

  • shahoodshahood Member ✭✭

    @AmosDuveen still waiting for ur reply on the above issue.

  • AmosDuveenAmosDuveen Member, Administrator, Moderator admin

    Hi @shahood,

    I must have missed the original. Sorry.

    The answer you are looking for is that earth tremor is a valid lemma which is a more precise synonym for one of the senses of tremor (we call these embedded lemmas, although they are being phased out of the data). As a result, earth tremor is a matchable form in the search, which is why it appears as the 'word'; however, the definition can only be found under the entry tremor.

Sign In or Register to comment.