@@ -128,19 +128,48 @@ class ProjectStore {
128128 } ;
129129 }
130130
131- /** Demo alignment for first-time users */
132- loadExample ( ) {
131+ /**
132+ * Demo alignments for first-time users.
133+ *
134+ * - `simple`: English↔French with one many-to-many pair (English `world` ↔ French `le monde`)
135+ * so newcomers immediately see that a single source word can connect to multiple target words.
136+ * - `complex`: Turkish↔English showcasing agglutination and the token-splitter feature. One Turkish
137+ * "word" (`Ev.im.de.yim` — "I am at my house") is split on `.` into 4 morphemes, and the copula
138+ * `yim` links to both English `I` and `am` (1-to-many). Forces `.` into the split chars if the
139+ * user has removed it, otherwise the example degenerates into a single unsplit token.
140+ */
141+ loadExample ( kind : 'simple' | 'complex' = 'simple' ) {
142+ const palette = settingsStore . settings . palette ;
143+
144+ if ( kind === 'simple' ) {
145+ this . loadSnapshot ( {
146+ sourceText : 'Hello world' ,
147+ targetText : 'Bonjour le monde' ,
148+ sourceGlosses : [ ] ,
149+ targetGlosses : [ ] ,
150+ links : [ ]
151+ } ) ;
152+ this . addAlignment ( [ 's-0' ] , [ 't-0' ] , palette ) ;
153+ this . addAlignment ( [ 's-1' ] , [ 't-1' , 't-2' ] , palette ) ;
154+ return ;
155+ }
156+
157+ if ( ! settingsStore . settings . tokenSplitChars . includes ( '.' ) ) {
158+ settingsStore . patch ( {
159+ tokenSplitChars : settingsStore . settings . tokenSplitChars + '.'
160+ } ) ;
161+ }
133162 this . loadSnapshot ( {
134- sourceText : 'The cat sleeps ' ,
135- targetText : 'Le chat dort ' ,
163+ sourceText : 'Ev.im.de.yim ' ,
164+ targetText : 'I am at my house ' ,
136165 sourceGlosses : [ ] ,
137166 targetGlosses : [ ] ,
138167 links : [ ]
139168 } ) ;
140- const p = settingsStore . settings . palette ;
141- this . addAlignment ( [ 's-0 ' ] , [ 't-0 ' ] , p ) ;
142- this . addAlignment ( [ 's-1 ' ] , [ 't-1 ' ] , p ) ;
143- this . addAlignment ( [ 's-2 ' ] , [ 't-2' ] , p ) ;
169+ this . addAlignment ( [ 's-0' ] , [ 't-4' ] , palette ) ;
170+ this . addAlignment ( [ 's-1 ' ] , [ 't-3 ' ] , palette ) ;
171+ this . addAlignment ( [ 's-2 ' ] , [ 't-2 ' ] , palette ) ;
172+ this . addAlignment ( [ 's-3 ' ] , [ 't-0' , 't-1' ] , palette ) ;
144173 }
145174
146175 loadSnapshot ( s : ProjectSnapshotV1 ) {
0 commit comments