Commits

Martin Ostrovsky  committed 1d68c86

added nouns to clients

  • Participants
  • Parent commits a3e1415

Comments (0)

Files changed (5)

File c#/RepustateClient.cs

         public static string SENTIMENT_PATH = "/score";
         public static string SENTIMENT_BULK_PATH = "/bulk-score";
         public static string ADJECTIVES_PATH = "/adj";
+        public static string NOUNS_PATH = "/noun";
         public static string VERBS_PATH = "/verb";
         public static string CLEAN_HTML_PATH = "/clean-html";
         public static string NGRAMS_PATH = "/ngrams";
 		    string output = sendRequest(SENTIMENT_PATH + format, "", "POST", getContentFromDictionary(data));
 		    return output;
 	    }
+	    
+        public static string getNouns(string format, Dictionary<string, string> data) 
+	    {
+		    //curl -d "text=This is a big block of new text" http://api.repustate.com/v2/demokey/adj.xml
+		    string output = sendRequest(NOUNS_PATH + format, "", "POST", getContentFromDictionary(data));
+		    return output;
+	    }
 	
 	    public static string getAdjectives(string format, Dictionary<string, string> data) 
 	    {

File java/RepustateClient.java

 	public static String SENTIMENT_PATH = "/score";
 	public static String SENTIMENT_BULK_PATH = "/bulk-score";
 	public static String ADJECTIVES_PATH = "/adj";
+	public static String NOUNS_PATH = "/noun";
 	public static String VERBS_PATH = "/verb";
 	public static String CLEAN_HTML_PATH = "/clean-html";
 	public static String NGRAMS_PATH = "/ngrams";
 		return output;
 	}
 	
+    public static String getNouns(String format, Map<String, String> data) throws MalformedURLException, IOException, RepustateException
+	{
+		//curl -d "text=This is a big block of new text" http://api.repustate.com/v2/demokey/noun.xml
+		String output = sendRequest(NOUNS_PATH + format, "", "POST", getContentFromMap(data));
+		return output;
+	}
+	
 	public static String getAdjectives(String format, Map<String, String> data) throws MalformedURLException, IOException, RepustateException
 	{
 		//curl -d "text=This is a big block of new text" http://api.repustate.com/v2/demokey/adj.xml

File php/Repustate.php

         return $this->callApi('clean-html', array('url' => $url),
                               $useHttpGet=TRUE);
     }
+    
+    public function nouns($cloud=null, $text=null, $url=null, $lang='en')
+    {
+        if (is_array($cloud))
+        {
+            extract($cloud, EXTR_IF_EXISTS);
+            if (is_array($cloud))
+            {
+                $cloud = null;
+            }
+        }
+        return $this->callNaturalLanguage('noun', $cloud, $text, $url, $lang);
+    }
 
     public function adjectives($cloud=null, $text=null, $url=null, $lang='en')
     {

File python/repustate.py

         Clean up a web page. It doesn't work well on home pages - it's designed for content pages.
         """
         return self._call_api('clean-html', use_http_get=True, url=url)
+    
+    def nouns(self, cloud=None, text=None, url=None, lang='en'):
+        # Only English language for now.
+        return self._call_natural_language('noun', cloud=cloud, text=text, url=url, lang=lang)
 
     def adjectives(self, cloud=None, text=None, url=None, lang='en'):
         return self._call_natural_language('adj', cloud=cloud, text=text, url=url, lang=lang)

File ruby/repustate.rb

     use_http_get = true
     call_api('clean-html', options, use_http_get)
   end
+  
+  def nouns(options={:cloud => nil, :text => nil, :url => nil, :lang => 'en'})
+    call_natural_language('noun', options)
+  end
 
   def adjectives(options={:cloud => nil, :text => nil, :url => nil, :lang => 'en'})
     call_natural_language('adj', options)