Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some spelling and language problem #46

Merged
merged 2 commits into from Jan 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -34,7 +34,7 @@

@RestController
@RequestMapping("documents/{docId}/anchorboundary")
public class AnchorBoundaryContoller {
public class AnchorBoundaryController {

@Autowired
private ApplicationContext applicationContext;
Expand Down Expand Up @@ -68,7 +68,7 @@ public void createAnchorBoundary(@PathVariable("docId") String docId, @PathVaria
geometry = Convert2Json.json2Geometry(json.get("geometry"));
}

// TODO : ���߿� ��ĥ ��. �ӽ÷�.
// TODO: fix it later
if (json.has("duality")) {
duality = json.get("duality").asText().trim();
}
Expand Down
Expand Up @@ -112,7 +112,7 @@ public void createAnchorSpace(@PathVariable("id") String id, @RequestBody Object
generalGeometry = Convert2Json.json2Geometry(geometry);
}

// TODO : ���߿� ��ġ��!!
// TODO: fix it later
// String properties = json.get("properties").asText().trim();
// String duality = null;

Expand Down Expand Up @@ -192,7 +192,7 @@ public void updateAnchorSpace(@PathVariable("docId") String docId, @PathVariable

}

// TODO : ���߿� ��ġ��!!
// TODO: fix it later
// String properties = json.get("properties").asText().trim();
// String duality = null;

Expand Down
Expand Up @@ -75,7 +75,7 @@ public void createCellSpaceBoundary(@PathVariable("docId") String docId,@PathVar
geometry = Convert2Json.json2Geometry(json.get("geometry"));
}

//TODO : ���߿� ��ĥ ��. �ӽ÷�.
//TODO: fix it later
if(json.has("duality")){
duality = json.get("duality").asText().trim();
}
Expand Down
Expand Up @@ -105,7 +105,7 @@ public void createCellSpace(@PathVariable("id") String id, @RequestBody ObjectNo
}


//TODO : ���߿� ��ġ��!!
//TODO: fix it later
//String properties = json.get("properties").asText().trim();
//String duality = null;

Expand Down Expand Up @@ -185,7 +185,7 @@ public void updateCellSpace(@PathVariable("docId") String docId,@PathVariable("i

}

//TODO : ���߿� ��ġ��!!
//TODO: fix it later
//String properties = json.get("properties").asText().trim();
//String duality = null;

Expand Down
Expand Up @@ -67,7 +67,7 @@ public void createConnectionBoundary(@PathVariable("docId") String docId, @PathV
geometry = Convert2Json.json2Geometry(json.get("geometry"));
}

// TODO : ���߿� ��ĥ ��. �ӽ÷�.
// TODO: fix it later
if (json.has("duality")) {
duality = json.get("duality").asText().trim();
}
Expand Down
Expand Up @@ -112,7 +112,7 @@ public void createConnectionSpace(@PathVariable("id") String id, @RequestBody Ob
generalGeometry = Convert2Json.json2Geometry(geometry);
}

// TODO : ���߿� ��ġ��!!
// TODO: fix it later
// String properties = json.get("properties").asText().trim();
// String duality = null;

Expand Down Expand Up @@ -192,7 +192,7 @@ public void updateConnectionSpace(@PathVariable("docId") String docId, @PathVari

}

// TODO : ���߿� ��ġ��!!
// TODO: fix it later
// String properties = json.get("properties").asText().trim();
// String duality = null;

Expand Down
Expand Up @@ -116,7 +116,7 @@ public void createGeneralSpace(@PathVariable("id") String id, @RequestBody Objec
}


//TODO : ���߿� ��ġ��!!
//TODO: fix it later
//String properties = json.get("properties").asText().trim();
//String duality = null;

Expand Down Expand Up @@ -199,7 +199,7 @@ public void updateGeneralSpace(@PathVariable("docId") String docId,@PathVariable
}


//TODO : ���߿� ��ġ��!!
//TODO: fix it later
//String properties = json.get("properties").asText().trim();
//String duality = null;

Expand Down
Expand Up @@ -146,7 +146,7 @@ public void updateState(@PathVariable("docId") String docId,@PathVariable("id")

}

//TODO : ���߿� ��ġ��!!
//TODO: fix it later
//String properties = json.get("properties").asText().trim();
//String duality = null;

Expand Down
Expand Up @@ -155,7 +155,7 @@ public void updateTransition(@PathVariable("docId") String docId,@PathVariable("

}

//TODO : ���߿� ��ġ��!!
//TODO: fix it later
//String properties = json.get("properties").asText().trim();
//String duality = null;

Expand Down
Expand Up @@ -116,7 +116,7 @@ public void createtransitionSpace(@PathVariable("id") String id, @RequestBody Ob
}


//TODO : ���߿� ��ġ��!!
//TODO: fix it later
//String properties = json.get("properties").asText().trim();
//String duality = null;

Expand Down Expand Up @@ -199,7 +199,7 @@ public void updatetransitionSpace(@PathVariable("docId") String docId,@PathVaria
}


//TODO : ���߿� ��ġ��!!
//TODO: fix it later
//String properties = json.get("properties").asText().trim();
//String duality = null;

Expand Down
Expand Up @@ -435,10 +435,6 @@ private static SpaceLayerType change2JaxbClass(IndoorGMLMap savedMap, SpaceLayer

List<EdgesType> edgesTypeList = new ArrayList<EdgesType>();

// node ����ͼ�
// node ���� statemember ã�Ƽ�
// �� ������ association����.

List<NodesType> nodesTypeList = new ArrayList<NodesType>();

for (int i = 0; i < feature.getNodes().size(); i++) {
Expand Down Expand Up @@ -1172,4 +1168,4 @@ public static ConnectionBoundaryType change2JaxbClass(IndoorGMLMap savedMap, Con
return newFeature;
}

}
}
Expand Up @@ -203,7 +203,6 @@ public static void deleteAnchorBoundary(IndoorGMLMap map, String id) {
duality.resetDuality();
}

// cellspace ã�ư��� partialboundedby ����
CellSpace cellspaceForPartialBoundedBy = target.getCellSpace();
cellspaceForPartialBoundedBy.deletePartialBoundedBy(target);

Expand Down
Expand Up @@ -206,7 +206,6 @@ public static void deleteCellSpaceBoundary(IndoorGMLMap map, String id) {
duality.resetDuality();
}

//cellspace ã�ư��� partialboundedby ����
CellSpace cellspaceForPartialBoundedBy = target.getCellSpace();
cellspaceForPartialBoundedBy.deletePartialBoundedBy(target);

Expand Down
Expand Up @@ -205,10 +205,9 @@ public static void deleteConnectionBoundary(IndoorGMLMap map, String id) {
duality.resetDuality();
}

// cellspace ã�ư��� partialboundedby ����
CellSpace cellspaceForPartialBoundedBy = target.getCellSpace();
cellspaceForPartialBoundedBy.deletePartialBoundedBy(target);

map.removeFeature(id);
}
}
}
78 changes: 78 additions & 0 deletions tool/check.py
@@ -0,0 +1,78 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''check.py: check non ascii charactor.'''

import os
import sys
import argparse
import codecs
import chardet

__author__ = 'Kunlin Yu <yukunlin@syriusrobotics.com>'
__maintainer__ = 'Kunlin Yu <yukunlin@syriusrobotics.com>'

cancel = '\033[00m'
brown = '\033[0;33m'
blue = '\033[0;34m'
cyan = '\033[0;36m'
red = '\033[01;31m'
yellow = '\033[01;33m'
red_bg = '\033[01;41m'

def match_suffix(suffix_list, filename):
for suffix in suffix_list:
if filename.endswith(suffix):
return True
return False

def ascii_one_file_check(filename):
f = open(filename, 'rb')
lines = f.readlines()
error_count = 0;
for index, line in enumerate(lines):
try:
codecs.decode(line, 'ascii')
except UnicodeDecodeError:
# print('%s%s:%s%s: %serror%s: non-ascii charactor:\n%s' % (cyan, filename, index + 1, cancel, red, cancel, str(line)))
print('%s%s:%s%s: %snote%s: char detect result:\n%s' % (cyan, filename, index + 1, cancel, blue, cancel, str(line)))
print(chardet.detect(line))
error_count += 1
return error_count;

def ascii_char_check(args):
suffix_list = ['.py', '.c', '.h', '.cc', '.hh', '.cpp', '.txt', '.xml', 'README', '.md', '.java', 'gml']

error_count = 0
for path in args.paths:
for root, dirs, files in os.walk(path):
for filename in files:
if match_suffix(suffix_list, filename):
error_count += ascii_one_file_check(os.path.join(root, filename))
print('ascii char check total error found: ' + str(error_count))
return error_count

def parse_args(sysargs=None):
parser = argparse.ArgumentParser(
description="Utility to aid in building Sirius packages.",
add_help=True)
parser.add_argument('--demo', action='store_true', help='demo help')
parser.add_argument('--paths', choices=None, help='paths name to be check')

args = parser.parse_args(sysargs[1:])

if args.paths:
args.paths = [os.getcwd() + item for item in args.paths.split(',')]
else:
args.paths = ["."]

return args

def main(sysargs):
args = parse_args(sysargs)
print(args)

ascii_char_check(args)

if __name__ == '__main__':
main(sys.argv)