You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
294 B
Python
13 lines
294 B
Python
2 years ago
|
import wordsegment
|
||
|
from wordsegment import load, segment
|
||
|
from flask import Flask, json, request
|
||
|
load()
|
||
|
|
||
|
api = Flask(__name__)
|
||
|
|
||
|
@api.route('/domain/<string:name>', methods=['GET'])
|
||
|
def get_words(name: str):
|
||
|
return json.dumps(segment(name))
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
api.run()
|