This folder contains a script which can be used to build the context and design (and neither) vocabularies from identifiers in a codebase(s).
- Ensure that
design.txt,context.txtandneither.txtis in the../vocabularies/your-domain-name"folder - Ensure that the codebases are in the
../../data/your-domain-namefold
- Uncomment this line. Ensure only this line in uncommented inside the
if __name__ == "__main__":block.
saveTermsToBeCategorised([getPath("../../data/ugrad-009-01/design1000")], "ugrad-009-01")- Replace the first argument with the path to the codebase.
- Replace the second argument with the name of the folder containing the codebases and text files e.g.
your-domain-name. - From the repo root, run the script with
python -m src.vocabularyBuilder. to-categorise.csvwill be created in this folder.- For the terms that you want to add to the context vocabulary, write a
cin the 2nd column. - For the terms that you want to add to the design vocabulary, write a
din the 2nd column. - For the remaining terms, write an
nin the 2nd column. - Save the file.
- Uncomment this line. Ensure only this line in uncommented inside the
if __name__ == "__main__":block.
saveCategoriseSheetToTxt("ugrad-009-01")- Replace the first argument with the name of the name of the folder containing the codebases and text files.
- The terms that you indicated with a
c,dorninto-categorise.csvwill be added to the context, design and neither vocabulary incontext.txt,design.txtandneither.txt, respectively.
- Similar process to above, except use the path of the folder containing all the codebases e.g.
saveTermsToBeCategorised(findRepoPaths(getPath("../data/ugrad-009-01/")), "ugrad-009-01")- Similar process to the above, except include the previous categorisations in
context-answers.txt,design-answers.txtandneither-answers.txtin the../vocabularies/your-domain-name"folder. - The call to
saveTermsToBeCategorisedwill automatically add the terms that are both in the codebase and in the answers to the vocabulary text files. - Check the last line of the console output to verify whether you need to categorise any further terms.