Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add line (general) notes, line footnotes, line pronunciation notes #95

Open
sarabveer opened this issue Jan 10, 2019 · 4 comments
Open
Labels
Impacts Some Affects the average end-user. □ Type Story Feature or requirement written from the user's perspective using non-technical language.

Comments

@sarabveer
Copy link
Collaborator

sarabveer commented Jan 10, 2019

  1. Allow different forms of the gurmukhi paath
  2. Padsheds and Vishrams will be linked to their respective variants.
  3. A field to enter in notes
@sarabveer sarabveer added the □ Type Story Feature or requirement written from the user's perspective using non-technical language. label Jan 10, 2019
@sarabveer sarabveer changed the title Add support for alternate Pad Sheds Add support for alternative Pad Sheds Jan 10, 2019
@bhajneet
Copy link
Member

Notes should include where SGPC saroops differ with themselves as well. Basically any research info that can help others in the future.

Notes field should be on by default in desktop app. Alternate Pad Shed option can be discussed after notes are filled out. Default pad shed should be some variation of SGPC.

@Harjot1Singh
Copy link
Member

Some random experiments:

Duplicating the lines column adds ~10MB.

Adding two random "padshed" columns with the same line data but randomised spaces adds ~20MB.

Script

const { random } = require( 'lodash' )

const { Lines, knex } = require( '..' )

const randomSpace = str => {
  const index = random( 0, str.length - 1 )
  return `${str.slice( 0, index )} ${str.slice( index )}`
}

const main = async () => {
  const lines = await Lines.query().orderBy( 'order_id', 'desc' )

  const newLines = lines.map( ( { id, gurmukhi } ) => {
    // Add 3 random spaces
    const padched1 = randomSpace( randomSpace( randomSpace( gurmukhi ) ) )
    const padched2 = randomSpace( randomSpace( randomSpace( gurmukhi ) ) )

    return { id, padched1, padched2 }
  } )

  await knex.transaction( trx => {
    const queries = newLines.map( ( { id, ...rest } ) => Lines.query().where( 'id', id ).update( rest ).transacting( trx ) )

    return Promise.all( queries ).then( trx.commit )
  } )
}

main()
  .then( () => process.exit( 0 ) )
  .catch( async e => {
    console.error( e.message )
    console.error( e )
    process.exit( 1 )
  } )

@Harjot1Singh
Copy link
Member

Leaning towards adding new table which has overrides (with inline variation within object per line in JSON)

@Harjot1Singh
Copy link
Member

ANother option: create variation copy of data folder for each variant

@sarabveer sarabveer mentioned this issue Mar 2, 2020
@bhajneet bhajneet changed the title Add support for Notes field and alternative Pad Sheds Add line notes (per published source) Mar 6, 2020
@sarabveer sarabveer changed the title Add line notes (per published source) Add support for different Gurmukhi Variants Mar 11, 2020
@bhajneet bhajneet changed the title Add support for different Gurmukhi Variants Add line (general) notes, line footnotes, line pronunciation notes Mar 16, 2020
@bhajneet bhajneet added Impacts Some Affects the average end-user. Status: Confirmed and removed Impacts All Affects nearly all or all end-users! Status: In Research labels Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Impacts Some Affects the average end-user. □ Type Story Feature or requirement written from the user's perspective using non-technical language.
Projects
None yet
Development

No branches or pull requests

3 participants