This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for e in iter(temp.find()): | |
new_sensesJa=[] | |
for ss in e['sensesJa']: | |
new_gloss=[] | |
gloss_cp=copy.deepcopy(ss['gloss']) | |
# combine mis-splited glosses | |
for idx_gls,gls in enumerate(ss['gloss']): | |
# if gls ends with KanjiKana and `idx_gls!=len(ss['gloss'])-1:` | |
# :"一(動バ上二)⇒のびる二(動バ下二)⇒のべる" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File "/home/xunlei/xunlei-lixian/lixian_commands/download.py", line 65, in download1 | |
download() | |
File "/home/xunlei/xunlei-lixian/lixian_download_tools.py", line 29, in __call__ | |
self.tool(self.client, self.url, self.path, self.resuming) | |
File "/home/xunlei/xunlei-lixian/lixian_download_tools.py", line 71, in wget_download | |
raise Exception('wget exited abnormally') | |
Exception: wget exited abnormally |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#encoding: utf-8 | |
#__author__ = 'actor2019' | |
# daijirin is much neater than `daijisen` | |
#conn | |
from pymongo import * | |
conn = MongoClient() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in most cases, less than 3 documents | |
es= list(jp.find({'title':t})) | |
if es: | |
flagNotFound=False | |
# init the correct_e | |
the_e=None | |
# if len(es)==1 | |
if len(es)==1: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getPage(urlPage): | |
""" | |
:param urlPage: | |
:return: | |
""" | |
res = requests.get(urlPage) | |
urlWords = bs(res.content).select('div#listWrapper a') | |
BASE_url=r'http://kotobank.jp' | |
for idx_word,uw in enumerate(urlWords): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#encoding: utf-8 | |
#__author__ = 'actor2019' | |
# $http.get('/ja/word/あい') | |
from pyramid.security import ( | |
Allow, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// $scope.$watch('settingsTogo.advancedSettings.length', function(){ | |
$scope.updateDescriptors = function(){ | |
var ace=$scope.settingsTogo.advancedSettings; | |
var raw_odList=ace.slice(ace.lastIndexOf('>')+1).split('[\'');//console.log(raw_odList); | |
var orDescriptorsTemp=[]; | |
var orDscMsgsTemp=[]; | |
_.each(raw_odList,function(rod, idx, list){ | |
// each rod if no ']' return else good push it to orDescriptors | |
if(rod.length<5||rod.indexOf(']')==-1) return; | |
//eval od to array=['name',[1,2,3]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#encoding: utf-8 | |
from django.conf import settings | |
from django.db.models import signals | |
from django.db import transaction | |
# | |
# from tbhBase import models as tbhBaseModels | |
# from tbhBase.models import Rst,Rvw |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//works. | |
//in html | |
// <div><scatter-chart id-d3="rulesScatterChart" name-d3="scatterChartRulesData" | |
// class="rnia-scatter-chart" ></scatter-chart></div> | |
//. |