Alexander Rose 7 years ago
parent
commit
ab404049a4
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/apps/cif2bcif/field-classifier.ts

+ 2 - 0
src/apps/cif2bcif/field-classifier.ts

@@ -11,6 +11,8 @@ import { FieldDefinition, FieldType } from 'mol-io/writer/cif/encoder'
 const intRegex = /^-?\d+$/
 const floatRegex = /^-?(([0-9]+)[.]?|([0-9]*[.][0-9]+))([(][0-9]+[)])?([eE][+-]?[0-9]+)?/
 
+// Classify a cif field as str, int or float based the data it contains.
+// To classify a field as int or float all items are checked.
 function classify(name: string, field: Field): FieldDefinition {
     let floatCount = 0, hasString = false;
     for (let i = 0, _i = field.rowCount; i < _i; i++) {