MCPcopy Create free account
hub / github.com/THUNLP-MT/MEAN / split

Function split

evaluation/TMscore.cpp:2554–2572  ·  view source on GitHub ↗

split a long string into vectors by whitespace * line - input string * line_vec - output vector * delimiter - delimiter */

Source from the content-addressed store, hash-verified

2552 * line_vec - output vector
2553 * delimiter - delimiter */
2554void split(const string &line, vector<string> &line_vec,
2555 const char delimiter=' ')
2556{
2557 bool within_word = false;
2558 for (size_t pos=0;pos<line.size();pos++)
2559 {
2560 if (line[pos]==delimiter)
2561 {
2562 within_word = false;
2563 continue;
2564 }
2565 if (!within_word)
2566 {
2567 within_word = true;
2568 line_vec.push_back("");
2569 }
2570 line_vec.back()+=line[pos];
2571 }
2572}
2573
2574/* strip white space at the begining or end of string */
2575string Trim(const string &inputString)

Callers 3

get_PDB_linesFunction · 0.85
output_pymolFunction · 0.85
output_rasmolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected