If a group isn't a Lie group is there still an algebraic way for a projective representation to arise? Weinberg in chapter 2.7 of "The quantum theory of fields, vol.1" writes that projective representations arise in two ways: topologically, if the group is not simply connected, and algebraically, if its Lie algebra $\mathfrak{g}$ can be enlarged into a bigger algebra which contains extra generators commuting with those of $\mathfrak{g}$.

*

*Is it correct to say that the topological way corresponds to $G$ having non-trivial two-cocycles and the algebraic way corresponds to its Lie algebra having non-trivial two-cocycles?


*If the group is not a Lie group is there an algebraic way?
 A: I don't think the distinction between "algebraic" and "topological" is very helpful here since Lie theory (and the notion of a topological group in general) inherently fuses many algebraic and topological properties. However it is correct that there are "two ways" in which a Lie group can have central extensions by $\mathrm{U}(1)$:

*

*When the group is not simply-connected, then there are central extensions that just "come from" the universal cover of the Lie group, not from any sort of true "algebraic" extension. The reason one might call these extensions "topological" is because they are not just central extensions but also $\mathrm{U}(1)$-bundles. Purely topologically, $\mathrm{U}(1)$-bundles over $G$ are classified by their Chern classes $H^2(G,\mathbb{Z})$, and one can show that a semi-simple Lie group has $H^2(G,\mathbb{Z})\cong \pi_1(G)$, i.e. the group has non-trivial $\mathrm{U}(1)$-bundles precisely when it is not simply-connected. The idea of this should be the same as in this answer of mine to a previous question of yours where I try to construct the bundle/extension explicitly.


*When the group is simply-connected, then all non-trivial central extensions are "algebraic" in the sense that they must also be non-trivial extensions of the Lie algebra by $\mathbb{R}$. Note that $H^2(\mathfrak{g},\mathbb{R}) = 0$ for semi-simple Lie algebras, i.e. for semi-simple Lie groups all extensions are purely "topological" in the sense of the first point, which is why the general theory of central extensions is rarely developed in the context of physics - most Lie groups that play a role in physics are semi-simple, and the first point at which this concept becomes relevant is often the Witt algebra of conformal field theory.
For a group that is not a Lie group, this distinction doesn't make a lot of sense - a non-Lie group doesn't have an associated algebra $\mathfrak{g}$, so we can't talk about extensions of the group that are not also trivial extensions of the algebra. For general groups, the only object that classifies central extensions is the group cohomology $H_\text{grp}^2(G,\mathrm{U}(1))$ which is not in general an easy object to compute and has a priori no "topological" or "algebraic" parts.
