<commit_before># Installing guide
This guide explains how to prepare your OS to run the project medcodeassist of EONUM.
<br>
Development environment has to be linux.

## Linux (Ubuntu)
<b> Tested on Ubuntu 14.04 LTS </b>

#### Install Ruby 2.2.1, Rails 4.2, RVM, Git, ...

* Download mpapis public key: ``` gpg --keyserver hkp://keys.gnupg.net --recv-keys <KEY> ```
<br>
If the server times out, try ``` gpg --keyserver hkp://pgp.mit.edu --recv-keys <KEY> ```
* Install Curl: ``` sudo apt-get install curl ```
* Install ruby version manager (RVM) with rails: ```\curl -sSL https://get.rvm.io | bash -s stable --rails```
* Install git: ``` sudo apt-get install git ```

#### Clone the git repository medcodeassist
* Change to the directory where you want to clone the project.
* Clone the repo: ``` git clone https://github.com/eonum/medcodeassist.git ```

#### Install the gems
* Make sure to run the terminal as a login-shell (Edit->Profiles->Edit->Title and Command->run command as a login shell)
* Open a new bash
* Change to your cloned directory: ```cd medcodeassist ```
* Create a project-specific gemset: ``` rvm use ruby-2.2.1@medcodeassist --ruby-version --create ```
* Install the bundle: ``` bundle install ```

#### MongoDB
- Set up mongodb as described at <a href="https://docs.mongodb.org/manual/administration/install-on-linux/#recommended">this link</a>.

#### Run the rails server ####
* To run the server at port 3000, type: ``` bin/rails server -p 3000```
* Open your favorite browser and go to: ``` localhost:3000 ```<commit_msg>Squashed commit of the following:<commit_after># Installing guide
This guide explains how to prepare your OS to run the project medcodeassist of EONUM.
<br>
Development environment has to be linux.

## Linux (Ubuntu)
<b> Tested on Ubuntu 14.04 LTS </b>

#### Install Ruby 2.2.1, Rails 4.2, RVM, Git, ...

* Download mpapis public key: ``` gpg --keyserver hkp://keys.gnupg.net --recv-keys <KEY> ```
<br>
If the server times out, try ``` gpg --keyserver hkp://pgp.mit.edu --recv-keys <KEY> ```
* Install Curl: ``` sudo apt-get install curl ```
* Install ruby version manager (RVM) with rails: ```\curl -sSL https://get.rvm.io | bash -s stable --rails```
* Run ``` source /usr/local/rvm/scripts/rvm ```
* Install git: ``` sudo apt-get install git ```

#### Clone the git repository medcodeassist
* Change to the directory where you want to clone the project.
* Clone the repo: ``` git clone https://github.com/eonum/medcodeassist.git ```

#### Install the gems
* Make sure to run the terminal as a login-shell (Edit->Profiles->Edit->Title and Command->run command as a login shell)
* Open a new bash
* Change to your cloned directory: ```cd medcodeassist ```
* Create a project-specific gemset: ``` rvm use ruby-2.2.1@medcodeassist --ruby-version --create ```
* Install the bundle: ``` bundle install ```
* In order to execute javascript in ruby, install execjs runtime ``` gem install execjs ``` (see <a href="https://github.com/rails/execjs">link</a> for more information)

#### MongoDB
- Set up mongodb as described at <a href="https://docs.mongodb.org/manual/administration/install-on-linux/#recommended">this link</a>.

#### Run the rails server ####
* To run the server at port 3000, type: ``` bin/rails server -p 3000```
* Open your favorite browser and go to: ``` localhost:3000 ```
{'fraction_non_alphanumeric': 0.15377697841726617, 'fraction_numerical': 0.014388489208633094, 'mean_word_length': 4.01051051051051, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 29, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1483294', 'n_tokens_mistral': 1109, 'n_tokens_neox': 1043, 'n_words': 404}