<commit_before># cLASSjs
A JS library for defining enumerations, constructor-based classes, and class hierarchies, with semantic meta-data for declarative constraint validation and for generating model-based CRUD user interfaces.

## Use Case 1: Enumerations and enumeration attributes

### Defining an Enumeration

var WeatherStateEL = new eNUMERATION ("WeatherStateEL", 
    ["sunny", "partly cloudy", "cloudy", "cloudy with rain", "rainy"]);

### Using an Enumeration as the Range of an Attribute

var Weather = new cLASS({
    Name: "Weather",
    supertypeName: "oBJECT",
    properties: {
        "weatherState": {
            range: WeatherStateEL,
            label: "Weather conditions",
            shortLabel: "cond"
        },
        "temperature": {
            range: "Decimal",
            label: "Temperature"
        }
    },
    methods: {...}
});

### Using Enumeration Literals

Recall that *enumeration literals* are constants that stand for a positive integer (the *enumeration index*). 

For instance, the enumeration literal `WeatherStateEL.SUNNY` stands for the enumeration index 1. In program code, we do no use the enumeration index, but rather the enumeration literal. For instance, 

    var theWeather = new Weather({
          weatherState: WeatherStateEL.SUNNY, // do not use the value 1
          temperature: 30
    })

### Looping over an Enumeration

We loop over the enumeration `WeatherStateEL` with a `for` loop counting from 1 to `WeatherStateEL.MAX`:

    var i=0;
    for (i=1; i <= WeatherStateEL.MAX; i++) {
      switch (i) {
      case WeatherStateEL.SUNNY: 
	    ...
        break;
      case WeatherStateEL.PARTLY_CLOUDY: 
	    ...
        break;
      }
    }


## Use Case 2: Declarative Constraint Valdiation

T.B.D-<commit_msg>improve README.md<commit_after># cLASSjs
A JS library for defining enumerations, constructor-based classes, and class hierarchies, with semantic meta-data for declarative constraint validation and for generating model-based CRUD user interfaces.

## Use Case 1: Enumerations and Enumeration Attributes

### Defining an Enumeration

    var WeatherStateEL = new eNUMERATION ("WeatherStateEL", 
        ["sunny", "partly cloudy", "cloudy", "cloudy with rain", "rainy"]);

### Using an Enumeration as the Range of an Attribute

    var Weather = new cLASS({
        Name: "Weather",
        supertypeName: "oBJECT",
        properties: {
          "weatherState": {
              range: WeatherStateEL,
              label: "Weather conditions",
              shortLabel: "cond"
          },
          "temperature": {
              range: "Decimal",
              label: "Temperature"
          }
        },
        methods: {...}
    });

### Using Enumeration Literals

Recall that *enumeration literals* are constants that stand for a positive integer (the *enumeration index*). 

For instance, the enum literal `WeatherStateEL.SUNNY` stands for the enum index 1. In program code, we do no use the enum index, but rather the enum literal. For instance, 

    var theWeather = new Weather({
          weatherState: WeatherStateEL.SUNNY, // do not use the enum index value 1
          temperature: 30
    })

### Looping over an Enumeration

We loop over the enumeration `WeatherStateEL` with a `for` loop counting from 1 to `WeatherStateEL.MAX`:

    var i=0;
    for (i=1; i <= WeatherStateEL.MAX; i++) {
      switch (i) {
      case WeatherStateEL.SUNNY: 
	    ...
        break;
      case WeatherStateEL.PARTLY_CLOUDY: 
	    ...
        break;
      }
    }


## Use Case 2: Declarative Constraint Valdiation

T.B.D-
{'fraction_non_alphanumeric': 0.09525131907803389, 'fraction_numerical': 0.004998611496806442, 'mean_word_length': 2.664292980671414, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5462569', 'n_tokens_mistral': 1090, 'n_tokens_neox': 999, 'n_words': 370}