# Path: deepnlp/api_service.py
# def fetch_str_input(prompt):
# def init():
# def check_email_format(email):
# def connect(credentials):


import sys, os
import codecs
import requests
import json
import textrank
from urllib import quote
from deepnlp import api_service
#!/usr/bin/python
# -*- coding:utf-8 -*-

"""
Testing textrank Algorithm
Use deepnlp.org web API for word segmentation
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals


# Read document and segment words
docs = []
folder_path = os.path.dirname(os.path.abspath(__file__))
file_path = os.path.join(folder_path, 'docs.txt')
f = codecs.open(file_path, encoding='utf-8')
for line in f:
    lines = line.split("。")
    docs.extend(lines)
f.close()

# calling segmentation api
# login = api_service.init()          # registration, if failed, load default with limited access
login = {}

# Path: deepnlp/api_service.py
# def fetch_str_input(prompt):
# def init():
# def check_email_format(email):
# def connect(credentials):


# Path: deepnlp/textrank/test_textrank.py
import sys, os
import codecs
import requests
import json
import textrank
from urllib import quote
from deepnlp import api_service

#!/usr/bin/python
# -*- coding:utf-8 -*-

"""
Testing textrank Algorithm
Use deepnlp.org web API for word segmentation
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals


# Read document and segment words
docs = []
folder_path = os.path.dirname(os.path.abspath(__file__))
file_path = os.path.join(folder_path, 'docs.txt')
f = codecs.open(file_path, encoding='utf-8')
for line in f:
    lines = line.split("。")
    docs.extend(lines)
f.close()

# calling segmentation api
# login = api_service.init()          # registration, if failed, load default with limited access
login = {}

conn = api_service.connect(login)   # save the connection with login cookies