Export
diff --git a/frontend/src/components/Upload/UploadForm.vue b/frontend/src/components/Upload/UploadForm.vue
index 5f21d0d..f23bc84 100644
--- a/frontend/src/components/Upload/UploadForm.vue
+++ b/frontend/src/components/Upload/UploadForm.vue
@@ -196,7 +196,7 @@ export default {
message: this.$t('uploadForm.uploadSuccessMsg'),
type: 'success',
});
- this.$router.push(`/${this.$route.params.toolVersion}/visualize`);
+ this.$router.push(`/${this.$route.params.toolVersion}/visualize/`);
this.$emit('uploaded');
}
},
@@ -256,10 +256,11 @@ export default {
uploadURL() {
// const tokenization = this.formData.checkTokenize ? 'tokenized' : 'untokenized';
if (this.formData.annotated) {
- return `/upload/${this.$route.params.toolVersion}`; // This uploads annotated file, lang needed to be modified
+ // return `/swegram/beta/api/upload_text/${this.$route.params.toolVersion}`;
+ return `/swegram/beta/upload/${this.$route.params.toolVersion}`; // This uploads annotated file, lang needed to be modified
}
- return `/upload_annotate/${this.$route.params.toolVersion}`; // This actually means upload AND annotate
- // return '/upload_annotate/'; // This actually means upload AND annotate
+ return `/swegram/beta/upload_annotate/${this.$route.params.toolVersion}`; // This actually means upload AND annotate
+ // return '/swegram/beta/upload_annotate/'; // This actually means upload AND annotate
},
},
};
diff --git a/frontend/src/components/Upload/UploadPage.vue b/frontend/src/components/Upload/UploadPage.vue
index fec792c..db9f221 100644
--- a/frontend/src/components/Upload/UploadPage.vue
+++ b/frontend/src/components/Upload/UploadPage.vue
@@ -7,15 +7,16 @@
v-show="!showTextForm"
id="upload_annotate_main"
>
- {{ $tc('uploadPage.uploadMessage1', 0) }}
-
+ {{ $t('uploadPage.uploadMessage1') }}
+
+
{{ $tc('uploadPage.uploadMessage2', 0) }}
{{ $tc('uploadPage.uploadMessage2', 1) }}
{{ $tc('uploadPage.uploadMessage2', 2) }}
diff --git a/frontend/src/components/Visualize/VisualizePage.vue b/frontend/src/components/Visualize/VisualizePage.vue
index d881806..5bff3f7 100644
--- a/frontend/src/components/Visualize/VisualizePage.vue
+++ b/frontend/src/components/Visualize/VisualizePage.vue
@@ -66,7 +66,7 @@ export default {
checkCurrentTextParsed(newValue) {
if (newValue !== '0' && newValue) {
axios
- .get(`/api/get_text/${newValue}`)
+ .get(`/swegram/beta/api/get_text/${newValue}`)
.then((response) => {
this.currentTextParsed = JSON.parse(response.data)[0].fields.parsed;
})
@@ -93,7 +93,7 @@ export default {
if (this.currentText !== null && this.currentText !== '0') {
this.tokens = [];
axios
- .get(`/visualise_text/${this.currentText}/${this.currentPage}/`)
+ .get(`/swegram/beta/visualise_text/${this.currentText}/${this.currentPage}/`)
.then((response) => {
const { data } = response;
this.currentSentences = data.current_sentences;
diff --git a/frontend/src/i18n/langs/en.js b/frontend/src/i18n/langs/en.js
index f3dc888..1690a89 100644
--- a/frontend/src/i18n/langs/en.js
+++ b/frontend/src/i18n/langs/en.js
@@ -251,7 +251,7 @@ const en = {
},
uploadPage: {
annotateNewText: 'Annotate a new text',
- uploadMessage1: 'In order to annotate a new text, you can either | upload one or multiple (texts in format .doc, docx, .odt or .rtf, which are automatically converted into plain text), or | paste in a text.',
+ uploadMessage1: 'In order to annotate a new text, you can upload a plain text, or paste in a text.',
uploadMessage2: 'For more information how metadata is handled, see | help | in menu.',
textUploadButton: 'Upload a file',
textPasteButton: 'Paste in a text',
@@ -272,7 +272,7 @@ const en = {
uploadFailedMsg: 'An error occured\n{0}',
uploadErrNonText: 'Please upload text files only',
uploadErrFileTooBig: 'Please upload a file less than 100MB',
- beforeUploadWarning: 'Upload a big file could take up to several hours, are you sure you want to continue?',
+ beforeUploadWarning: 'Uploading and processing a big file can take time.',
},
...elementEN,
};
diff --git a/frontend/src/i18n/langs/sv.js b/frontend/src/i18n/langs/sv.js
index 4feea28..233dd8d 100644
--- a/frontend/src/i18n/langs/sv.js
+++ b/frontend/src/i18n/langs/sv.js
@@ -250,7 +250,7 @@ const sv = {
},
uploadPage: {
annotateNewText: 'Annotera ny text',
- uploadMessage1: 'För att annotera en ny text kan du antingen | ladda upp en eller flera textfiler (texter i format .doc, docx, .odt och .rtf konverteras automatiskt till ren text), eller | klistra in en text.',
+ uploadMessage1: 'För att annotera en ny text kan du ladda upp en klartext, eller klistra in en text.',
uploadMessage2: 'För information om hantering av metadata, se | hjälp | i menyn.',
textUploadButton: 'Ladda upp textfil',
textPasteButton: 'Klistra in text',
@@ -271,7 +271,7 @@ const sv = {
uploadFailedMsg: 'An error occured\n{0}',
uploadErrNonText: 'Please upload text files only',
uploadErrFileTooBig: 'Please upload a file less than 100MB',
- beforeUploadWarning: 'Upload a big file could take up to several hours, are you sure you want to continue?',
+ beforeUploadWarning: 'Upploading och parsering en stor fil kan ta lång tid',
},
...elementSV,
};
diff --git a/frontend/vue.config.js b/frontend/vue.config.js
index aec1ae9..e8b14e2 100644
--- a/frontend/vue.config.js
+++ b/frontend/vue.config.js
@@ -2,7 +2,9 @@ const BundleTracker = require('webpack-bundle-tracker');
module.exports = {
// on Windows you might want to set publicPath: "http://127.0.0.1:8080/"
- publicPath: 'http://0.0.0.0:8000/static/',
+ // ublicPath: 'http://0.0.0.0:8000/static/',
+ publicPath: 'http://0.0.0.0:8080/',
+ // publicPath: 'https://kasus.lingfil.uu.se/swegrambetastatic/',
outputDir: './dist/',
@@ -26,7 +28,7 @@ module.exports = {
// config.optimization.splitChunks(false);
config.optimization.splitChunks(false);
- config.resolve.alias.set('__STATIC__', 'static');
+ config.resolve.alias.set('__STATIC__', 'swegrambetastatic');
config.devServer
// the first 3 lines of the following code have been added to the configuration
diff --git a/frontend/webpack-stats.json b/frontend/webpack-stats.json
index 46c4a2a..c7067e8 100644
--- a/frontend/webpack-stats.json
+++ b/frontend/webpack-stats.json
@@ -3,43 +3,43 @@
"assets": {
"fonts/element-icons.535877f5.woff": {
"name": "fonts/element-icons.535877f5.woff",
- "path": "/home/rruan1/swegram/frontend/dist/fonts/element-icons.535877f5.woff",
- "publicPath": "http://0.0.0.0:8000/static/fonts/element-icons.535877f5.woff"
+ "path": "/home/rruan1/swegram_dev/swegram/frontend/dist/fonts/element-icons.535877f5.woff",
+ "publicPath": "http://0.0.0.0:8080/fonts/element-icons.535877f5.woff"
},
"fonts/element-icons.732389de.ttf": {
"name": "fonts/element-icons.732389de.ttf",
- "path": "/home/rruan1/swegram/frontend/dist/fonts/element-icons.732389de.ttf",
- "publicPath": "http://0.0.0.0:8000/static/fonts/element-icons.732389de.ttf"
- },
- "img/swe-clarin-logo.6a0e99ef.png": {
- "name": "img/swe-clarin-logo.6a0e99ef.png",
- "path": "/home/rruan1/swegram/frontend/dist/img/swe-clarin-logo.6a0e99ef.png",
- "publicPath": "http://0.0.0.0:8000/static/img/swe-clarin-logo.6a0e99ef.png"
+ "path": "/home/rruan1/swegram_dev/swegram/frontend/dist/fonts/element-icons.732389de.ttf",
+ "publicPath": "http://0.0.0.0:8080/fonts/element-icons.732389de.ttf"
},
"img/UU_logo_sv_84_transparent.a0393307.png": {
"name": "img/UU_logo_sv_84_transparent.a0393307.png",
- "path": "/home/rruan1/swegram/frontend/dist/img/UU_logo_sv_84_transparent.a0393307.png",
- "publicPath": "http://0.0.0.0:8000/static/img/UU_logo_sv_84_transparent.a0393307.png"
+ "path": "/home/rruan1/swegram_dev/swegram/frontend/dist/img/UU_logo_sv_84_transparent.a0393307.png",
+ "publicPath": "http://0.0.0.0:8080/img/UU_logo_sv_84_transparent.a0393307.png"
+ },
+ "img/swe-clarin-logo.6a0e99ef.png": {
+ "name": "img/swe-clarin-logo.6a0e99ef.png",
+ "path": "/home/rruan1/swegram_dev/swegram/frontend/dist/img/swe-clarin-logo.6a0e99ef.png",
+ "publicPath": "http://0.0.0.0:8080/img/swe-clarin-logo.6a0e99ef.png"
},
"bundle.css": {
"name": "bundle.css",
- "path": "/home/rruan1/swegram/frontend/dist/bundle.css",
- "publicPath": "http://0.0.0.0:8000/static/bundle.css"
+ "path": "/home/rruan1/swegram_dev/swegram/frontend/dist/bundle.css",
+ "publicPath": "http://0.0.0.0:8080/bundle.css"
},
"bundle.js": {
"name": "bundle.js",
- "path": "/home/rruan1/swegram/frontend/dist/bundle.js",
- "publicPath": "http://0.0.0.0:8000/static/bundle.js"
+ "path": "/home/rruan1/swegram_dev/swegram/frontend/dist/bundle.js",
+ "publicPath": "http://0.0.0.0:8080/bundle.js"
},
"index.html": {
"name": "index.html",
- "path": "/home/rruan1/swegram/frontend/dist/index.html",
- "publicPath": "http://0.0.0.0:8000/static/index.html"
+ "path": "/home/rruan1/swegram_dev/swegram/frontend/dist/index.html",
+ "publicPath": "http://0.0.0.0:8080/index.html"
},
"favicon.ico": {
"name": "favicon.ico",
- "path": "/home/rruan1/swegram/frontend/dist/favicon.ico",
- "publicPath": "http://0.0.0.0:8000/static/favicon.ico"
+ "path": "/home/rruan1/swegram_dev/swegram/frontend/dist/favicon.ico",
+ "publicPath": "http://0.0.0.0:8080/favicon.ico"
}
},
"chunks": {
@@ -48,5 +48,5 @@
"bundle.js"
]
},
- "publicPath": "http://0.0.0.0:8000/static/"
+ "publicPath": "http://0.0.0.0:8080/"
}
\ No newline at end of file
diff --git a/requirements.txt b/requirements.txt
index 1b933ad..7dbb6b4 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,6 +1,7 @@
Cython
jellyfish
openpyxl
+psycopg2
python-Levenshtein
requests
wheel
diff --git a/swegram/settings/base.py b/swegram/settings/base.py
index 65aaefc..29d68b4 100644
--- a/swegram/settings/base.py
+++ b/swegram/settings/base.py
@@ -75,7 +75,7 @@
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'swegram_main/static'),
- os.path.join(BASE_DIR, 'frontend/dist'),
+ # os.path.join(BASE_DIR, 'frontend/dist')
)
WEBPACK_LOADER = {
@@ -85,6 +85,8 @@
}
}
+CORS_ORIGIN_ALLOW_ALL = True
+
LOGGING_CONFIG = None
import logging.config
diff --git a/swegram/settings/beta.py b/swegram/settings/beta.py
index 97f8a57..da346ba 100644
--- a/swegram/settings/beta.py
+++ b/swegram/settings/beta.py
@@ -9,8 +9,9 @@
# STATIC_ROOT = "/local/etc/httpd/html/static/swegram/dev/"
# STATIC_URL = '/static/swegram/dev/'
-STATIC_ROOT = "/opt/swegram/frontend/dist/"
-STATIC_URL = "/static/"
+# STATIC_ROOT = "/opt/swegram/frontend/dist/"
+STATIC_ROOT = "/home/rruan1/swegram_dev/swegram/frontend/dist/"
+STATIC_URL = "/swegrambetastatic/"
'''
DATABASES = {
@@ -25,6 +26,13 @@
}
'''
+# To test connection with postgreql
+# psql -U swegram -h 127.0.0.1 -d swegram -p 5432 -W
+# enter password
+
+# works with the following command to connect swegram2
+# psql -d swegram2 -u rex -h numerus -p 5432 -W
+
DATABASES = {
'default': {
'ENGINE': "django.db.backends.postgresql_psycopg2",
@@ -36,10 +44,11 @@
}
}
+
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
- 'LOCATION': 'unique_snowflake',
+ 'LOCATION': 'unique_snowflake'
}
}
diff --git a/swegram/wsgi.py b/swegram/wsgi.py
old mode 100644
new mode 100755
diff --git a/swegram_main/pipeline/pipeline.py b/swegram_main/pipeline/pipeline.py
index 1f0a4a7..aa04156 100644
--- a/swegram_main/pipeline/pipeline.py
+++ b/swegram_main/pipeline/pipeline.py
@@ -1,6 +1,5 @@
"""Module of pipeline
-
Unclear how compound check performs
"""
@@ -11,6 +10,7 @@
from shutil import SameFileError
from typing import Optional
from swegram_main.data.texts import TextDirectory as TD
+from swegram_main.lib.logger import get_logger
from swegram_main.pipeline.preprocess import preprocess
from swegram_main.pipeline.postprocess import aggregate_conlls, save
from swegram_main.pipeline.postprocess import postprocess as _postprocess
@@ -18,7 +18,6 @@
from swegram_main.pipeline.lib.parse import parse as parse_
from swegram_main.pipeline.lib.tokenize import tokenize as tokenize_
from swegram_main.pipeline.lib.tag import tag as tag_
-from swegram_main.lib.logger import get_logger
logger = get_logger(__name__)
diff --git a/swegram_main/postgresql/client.py b/swegram_main/postgresql/client.py
new file mode 100644
index 0000000..e69de29
diff --git a/swegram_main/postgresql/setup.py b/swegram_main/postgresql/setup.py
new file mode 100644
index 0000000..0e3f0b0
--- /dev/null
+++ b/swegram_main/postgresql/setup.py
@@ -0,0 +1,3 @@
+"""Setup postgresql server
+
+"""
\ No newline at end of file