Input Text Reference

When an API call is made, OpenDover makes references to the input text in its response. It may refer to a sentiment word, a domain word or an object. The following tags are used to make a reference.

Tag Description
length The length of a word or phrase in the input text.
offset The offset of a word or phrase in the input text.
cleanText A piece of text normalized by OpenDover. Extra spaces and HTML markup are removed.

Example

"The GadgetY's lens is very  good".  There are 2 spaces between “very” and “good”.

The sample response below refers to the domain word “lens” twice (lines 12-14 and 20-22) and the sentiment word “very good” one time (lines 27-29). Pay attention to the length value in line 28. This value counts extra space character in the input.

 

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:searchSentimentsResponse xmlns:ns2="stubs.api.opendover.byelex.nl">
         <return>
            <domainRanks>
               <domainCode>product.camera</domainCode>
               <rank>1</rank>
            </domainRanks>
            <domainWords>
               <domainCodes>product.camera</domainCodes>
               <domainWord>
                  <cleanText>lens</cleanText>
                  <length>4</length>
                  <offset>14</offset>
               </domainWord>
            </domainWords>
            <sentiments>
               <domainCodes>product.camera</domainCodes>
               <domainWords>
                  <cleanText>lens</cleanText>
                  <length>4</length>
                  <offset>14</offset>
               </domainWords>
               <sentimentForce>4</sentimentForce>
               <sentimentType>APPRECIATION</sentimentType>
               <sentimentWord>
                  <cleanText>very good</cleanText>
                  <length>10</length>
                  <offset>22</offset>
               </sentimentWord>
            </sentiments>
         </return>
      </ns2:searchSentimentsResponse>
   </S:Body>
</S:Envelope>