1+ """
2+ Project Alias - Rename your assistant and makes sure it never listens.
3+ Copyright (C) 2020 Bjørn Karmann & Tore Knudsen
4+
5+ This program is free software: you can redistribute it and/or modify
6+ it under the terms of the GNU General Public License as published by
7+ the Free Software Foundation, either version 3 of the License, or
8+ (at your option) any later version.
9+
10+ This program is distributed in the hope that it will be useful,
11+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+ GNU General Public License for more details.
14+
15+ You should have received a copy of the GNU General Public License
16+ along with this program. If not, see <https://www.gnu.org/licenses/>.
17+ """
18+
119import json
220from modules import globals
321
@@ -15,8 +33,8 @@ def read():
1533# get setting and write names into keyphrase.list file
1634def updateServer (data ):
1735 print (data )
18- #sensitivity = data['setting']['sensitivity'] # 0 - 10
19-
36+ #sensitivity = data['setting']['sensitivity'] # 0 - 10
37+
2038 with open (globals .KEYWORD_PATH , 'w' ) as f :
2139 for item in data ['keyphrase' ]:
2240 #threshold = int(mapF(len(item['name']),4, 15, 0 , 30)) + int(sensitivity)
@@ -25,4 +43,4 @@ def updateServer(data):
2543 f .write ("%s\n " % keyphrase )
2644
2745def mapF (x , in_min , in_max , out_min , out_max ):
28- return (x - in_min ) * (out_max - out_min ) / (in_max - in_min ) + out_min ;
46+ return (x - in_min ) * (out_max - out_min ) / (in_max - in_min ) + out_min ;
0 commit comments