remove unused function nltk_get_attribute 82/192382/1
authorxiaochn.wang <xiaochn.wang@samsung.com>
Mon, 5 Nov 2018 06:33:54 +0000 (14:33 +0800)
committerxiaochn.wang <xiaochn.wang@samsung.com>
Mon, 5 Nov 2018 06:34:26 +0000 (14:34 +0800)
Change-Id: I99fee4720513c68d7ca626b460a465f9e4b815df

service/inc/service.h
service/src/service.c

index 3446edc36f07882b5ace3f54283cea71b32e03cd..5ede478894ffdae6009b2f6fa797927660a994ea 100755 (executable)
@@ -32,7 +32,6 @@ int nltk_get_size_from_tuple(PyObject* tuple);
 PyObject* nltk_get_element_from_tuple_by_index(PyObject* tuple, int index);
 PyObject* nltk_get_element_from_list_by_index(PyObject* list, int index);
 char* nltk_get_string_from_element(PyObject* elm);
-char* nltk_get_attribute(int z);
 PyObject* globe_nltk;
 PyObject* globe_lemm;
 PyObject* globe_lang;
index f8a1a6e564b10d2eda84cbfe90f85be7bcd88c03..8e05ca8acae99704c1737f79aaad45aa7327955a 100755 (executable)
@@ -662,38 +662,3 @@ PyObject* nltk_call_function_with_args(PyObject* func, PyObject* args)
     PRET_VM(!func, NULL, "Input parameter [func] is NULL!");
     return PyObject_CallObject(func, args);
 }
-
-// This is an example of an method to get attribute of module.
-char* nltk_get_attribute(int z)
-{
-    PyObject *pModule, *pFunc;
-    PyObject *pArgs;
-    char* ch = (char*) malloc(BUF_LEN_256);
-    if (ch != NULL)
-    {
-        memset(ch, 0, BUF_LEN_256);
-        pModule = PyImport_ImportModule("site");
-        if (pModule != NULL)
-        {
-        //create args tuple struct to fill the arg one by one  ,here ,only create one param with 1
-        pArgs = PyTuple_New(1);
-        //set a string for item 0 of tuple
-        PyTuple_SetItem(pArgs, 0, PyString_FromString("Hello World"));
-        //call word_tokenize func with args
-        pFunc = PyObject_GetAttrString(pModule, "USER_SITE");
-        if (pFunc != NULL) {
-            strncpy(ch, PyString_AsString(pFunc), BUF_LEN_256-1);
-            } else {
-            strncpy(ch, "attribute get error\n", BUF_LEN_256-1);
-            }
-        } else {
-            strncpy(ch, "nltk module import error\n", BUF_LEN_256-1);
-        }
-        return ch;
-    }
-    else
-    {
-        PERR("malloc failed");
-        return NULL;
-    }
-}