kornai / 4lang

Concept dictionary
MIT License
37 stars 13 forks source link

stanford parser should be made aware if the definition is expected to be an NP #8

Closed recski closed 9 years ago

recski commented 9 years ago

This is possible via an API call and crucial for definitions like this one (with current Stanford parse):

wavelength: the size of a radio wave used to broadcast a radio signal

  (ROOT
    (S
      (NP
        (NP (DT the) (NN size))
        (PP (IN of)
          (NP (DT a) (NN radio) (NN wave))))
      (VP (VBD used)
        (S
          (VP (TO to)
            (VP (VB broadcast)
              (NP (DT a) (NN radio) (NN signal))))))))

@pajkossy FYI

recski commented 9 years ago

Managed to run a parse with a custom constraint saying that the sentence must be an NP. The parse tree is now the one below, and we successfully get the dependencies root(ROOT-0, size-2), prep_of(size-2, wave-6), etc. Will proceed to enable this behaviour in dict_to_4lang based on POS-tags in Longman.

(ROOT
  (NP
    (NP (DT the) (NN size))
    (PP (IN of)
      (NP
        (NP (DT a) (NN radio) (NN wave))
        (VP (VBN used)
          (S
            (VP (TO to)
              (VP (VB broadcast)
                (NP (DT a) (NN radio) (NN signal))))))))))